Skip to content

Commit 7ff8745

Browse files
authored
Merge pull request #131 from OpenIPC/dev
Merge latest
2 parents de8bae2 + 97a5329 commit 7ff8745

File tree

7 files changed

+21
-5
lines changed

7 files changed

+21
-5
lines changed

OpenIPC_Config/Assets/Resources.Designer.cs

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

OpenIPC_Config/Assets/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,4 +299,7 @@ Add OSD SOC Temperature</value>
299299
<data name="RecordsNoTimeToolTip" xml:space="preserve">
300300
<value>When Onboard Recording is enabled and this is Enabled will not use time for recorded file naming, instead uses incremental numbering</value>
301301
</data>
302+
<data name="ALinkSwitchToolTip" xml:space="preserve">
303+
<value>Will enable or disable Adaptive Link, if you are on stock, it will use the default profile.</value>
304+
</data>
302305
</root>

OpenIPC_Config/Models/DeviceCommands.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static class DeviceCommands
7373
public static string GetNetworkCardType = "lsusb";
7474

7575
// Improved command to add alink_drone if not present
76-
public const string AddAlinkDroneToRcLocal = "grep -q \"alink_drone\" /etc/rc.local || sed -i '/^exit 0/i # Start alink drone service\\n/usr/bin/alink_drone --ip 10.5.0.10 --port 9999 \\&\\n' /etc/rc.local";
76+
public const string AddAlinkDroneToRcLocal = "grep -q \"alink_drone\" /etc/rc.local || sed -i '/^exit 0/i # Start alink drone service\\n/usr/bin/alink_drone \\&\\n' /etc/rc.local";
7777

7878
// Improved command to remove both the service line and its comment
7979
public const string RemoveAlinkDroneFromRcLocal = "sed -i '/# Start alink drone service/d; /alink_drone/d; /^$/d' /etc/rc.local";

OpenIPC_Config/Services/SysUpgradeService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public async Task PerformSysupgradeAsync(DeviceConfig deviceConfig, string kerne
3636
//updateProgress("Starting sysupgrade...");
3737
await _sshClientService.ExecuteCommandWithProgressAsync(
3838
deviceConfig,
39-
$"sysupgrade --force_all -n --kernel={OpenIPC.RemoteTempFolder}/{kernelFilename} --rootfs={OpenIPC.RemoteTempFolder}/{rootfsFilename}",
39+
$"sysupgrade --force_ver -n --kernel={OpenIPC.RemoteTempFolder}/{kernelFilename} --rootfs={OpenIPC.RemoteTempFolder}/{rootfsFilename}",
4040
updateProgress,
4141
cancellationToken
4242
);

OpenIPC_Config/ViewModels/AdvancedTabViewModel.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ public AdvancedTabViewModel(
8383

8484
#region Adaptive Link Methods
8585

86+
partial void OnIsAlinkDroneEnabledChanged(bool value)
87+
{
88+
// This will be called when the toggle switch changes
89+
_ = Task.Run(async () => await ToggleAlinkDroneAsync());
90+
}
91+
8692
// Method to toggle the alink_drone status
8793
private async Task ToggleAlinkDroneAsync()
8894
{
@@ -99,7 +105,7 @@ private async Task ToggleAlinkDroneAsync()
99105
}
100106

101107
// Toggle the value - this will be from the current to the new state
102-
bool newValue = !IsAlinkDroneEnabled;
108+
bool newValue = IsAlinkDroneEnabled;
103109

104110
// Execute the appropriate command based on the NEW value
105111
string command = newValue
@@ -189,6 +195,7 @@ private async Task CheckAdaptiveLinkStatusAsync()
189195

190196
var checkResult =
191197
await SshClientService.ExecuteCommandWithResponseAsync(deviceConfig, checkCommand, cancellationToken);
198+
192199
string statusOutput = checkResult?.Result?.Trim() ?? "Failed to check status";
193200

194201
if (statusOutput != "INSTALLED")

OpenIPC_Config/ViewModels/FirmwareTabViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ await Avalonia.Threading.Dispatcher.UIThread.InvokeAsync(() =>
10311031
});
10321032

10331033
ProgressValue = 100;
1034-
await _messageBoxService.ShowCustomMessageBox("Upgrade Complete!!", "Done reading from device!", ButtonEnum.Ok, Icon.Success);
1034+
await _messageBoxService.ShowCustomMessageBox("Upgrade Complete!!", "Device has been flashed!", ButtonEnum.Ok, Icon.Success);
10351035
Logger.Information("Firmware upgrade completed successfully.");
10361036
}
10371037
catch (Exception ex)

OpenIPC_Config/Views/AdvancedTabView.axaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
xmlns:vm="clr-namespace:OpenIPC_Config"
66
xmlns:viewModels="clr-namespace:OpenIPC_Config.ViewModels"
77
xmlns:converters="clr-namespace:OpenIPC_Config.Converters"
8+
xmlns:assets="clr-namespace:OpenIPC_Config.Assets"
89
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
910
x:Class="OpenIPC_Config.Views.AdvancedTabView"
1011
x:DataType="viewModels:AdvancedTabViewModel">
@@ -99,7 +100,7 @@
99100
</Grid>
100101

101102

102-
<StackPanel Orientation="Horizontal">
103+
<StackPanel Orientation="Horizontal" ToolTip.Tip="{x:Static assets:Resources.ALinkSwitchToolTip}">
103104
<TextBlock VerticalAlignment="Center">Alink Drone on Boot:</TextBlock>
104105
<ToggleSwitch IsChecked="{Binding IsAlinkDroneEnabled}"
105106
IsEnabled="{Binding CanConnect}"

0 commit comments

Comments
 (0)