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

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>
         <Nullable>enable</Nullable>
         <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>
         <WindowsPackaging>None</WindowsPackaging>
         <EnableMsixTooling>true</EnableMsixTooling>
@@ -16,7 +16,7 @@
     </PropertyGroup>
 
     <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-      <OutputPath>bin\Debug\</OutputPath>
+      <OutputPath>..\..\prs.desktop\bin\Debug\net8.0-windows\PRSAvalonia\</OutputPath>
     </PropertyGroup>
 
     <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()
     {
         PlatformTools.Bluetooth.Changed += BTChanged;
-        await PlatformTools.Bluetooth.StartScanningAsync(DigitalKey.ConfigServiceId);
+        await PlatformTools.Bluetooth.StartScanningAsync(PlatformTools.DigitalKeyServiceId);
         await base.OnActivated();
     }
 
@@ -115,11 +115,6 @@ public partial class EquipmentListViewModel : ModuleViewModel
         if (device == null)
             return;
         
-        var _time = DateTimeOffset.Now.ToUnixTimeSeconds();
-        var code = Authenticator.GenerateGoogleAuthenticatorCode(shell.ID.ToByteArray());
-
-        return;
-        
         bActive = true;
         _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 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>
         <Nullable>enable</Nullable>
         <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>
         <WindowsPackaging>None</WindowsPackaging>
         <EnableMsixTooling>true</EnableMsixTooling>
@@ -16,7 +16,7 @@
     </PropertyGroup>
 
     <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
-        <OutputPath>bin\Debug\</OutputPath>
+        <OutputPath>..\..\prs.desktop\bin\Debug\net8.0-windows\PRSDigitalKey</OutputPath>
     </PropertyGroup>
 
     <ItemGroup>

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

@@ -50,9 +50,15 @@ public class IssuesGrid : DynamicGrid<Kanban>, ISpecificGrid
     //     PropertyType = typeof(string),
     //     ClassType = typeof(Kanban)
     // };
+    
+    private String _baseDirectory;
 
     public IssuesGrid() : base()
     {
+        
+    
+        
+        
         var cols = LookupFactory.DefineColumns<Kanban>();
 
         // Minimum Columns for Lookup values
@@ -68,6 +74,8 @@ public class IssuesGrid : DynamicGrid<Kanban>, ISpecificGrid
     {
         private IssuesGrid Grid;
 
+        
+
         public UIComponent(IssuesGrid grid)
         {
             Grid = grid;
@@ -100,8 +108,36 @@ public class IssuesGrid : DynamicGrid<Kanban>, ISpecificGrid
 
         AddButton("Check for Updates", PRSDesktop.Resources.autoupdate.AsBitmapImage(), CheckForUpdates);
         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)
     {
         SupportUtils.OpenSupportSession();