Skip to content

Commit

Permalink
Merge pull request #5 from harp-tech/feature/update_device_id
Browse files Browse the repository at this point in the history
Update device ID on Firmware and App
  • Loading branch information
artursilva0 authored Jun 23, 2023
2 parents 954e56c + ca95e3a commit 93b078d
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 15 deletions.
31 changes: 23 additions & 8 deletions App/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ This repository folder contains the Syringe Pump GUI (henceforth GUI) applicatio

The Syringe Pump device is a Harp device and has all the inherent functionality of Harp devices.

The GUI was developed using [.NET 5](https://dotnet.microsoft.com/), [Avalonia](https://avaloniaui.net/) with ReactiveUI and makes direct use of the [Bonsai.Harp](https://github.com/bonsai-rx/harp) library.
The GUI was developed using [.NET 6](https://dotnet.microsoft.com/), [Avalonia](https://avaloniaui.net/) with ReactiveUI and makes direct use of the [Bonsai.Harp](https://github.com/bonsai-rx/harp) library.

As with other Harp devices, the Syringe Pump can also be used in [Bonsai](bonsai-rx.org/) using the [Bonsai.Harp.CF](https://github.com/bonsai-rx/harp.cf) package.

## Installation

Go to the [Downloads](https://bitbucket.org/fchampalimaud/device.pump/downloads/) page to download the latest version for your Operating System.
Go to the Releases page to download the latest version for your Operating System.

Currently there are x64 builds for Windows and Linux. Mac builds will be available in the future.

Expand All @@ -26,10 +26,6 @@ There might be other alternatives to this, but at least on Ubuntu and Fedora que
sudo usermod -a -G dialout <USERNAME>
```

## Usage

Usage information is available in the [Wiki](https://bitbucket.org/fchampalimaud/device.pump/wiki/Home).

## For developers

### Build Windows installer using NSIS manually
Expand All @@ -56,9 +52,28 @@ dotnet restore -r osx-x64 -p:TargetFramework=net6.0
dotnet msbuild -t:BundleApp -p:RuntimeIdentifier=osx-x64 -property:Configuration=Release -p:UseAppHost=true -p:TargetFramework=net6.0
```

### Build tar.gz package for Linux (either in Linux or WSL)

To build the tar.gz package, run the following commands on the solution folder:

First you need to make sure that the [`dotnet-packaging`](https://github.com/quamotion/dotnet-packaging) tool is installed

Run the following commands to install the tool:

```sh
dotnet tool install --global dotnet-tarball
```

Then run the following commands to build the tar.gz package:

```sh
dotnet restore -r linux-x64 -p:TargetFramework=net6.0
dotnet msbuild -p:RuntimeIdentifier=linux-x64 -property:Configuration=Release -p:UseAppHost=true -p:TargetFramework=net6.0 /t:CreateTarball
```

## Roadmap

See the [open issues](https://bitbucket.org/fchampalimaud/device.pump/issues) for a list of proposed features (and known issues).
See the [open issues](https://github.com/harp-tech/device.syringepump/issues) for a list of proposed features (and known issues).

## Contributing

Expand All @@ -72,7 +87,7 @@ Contributions are what make the open source community such an amazing place to b

## Authors

Scientific Hardware Platform and Scientific Software Platform of the Champalimaud Foundation.
Hardware & Software Platform of the Champalimaud Foundation.

### Main contributors

Expand Down
2 changes: 1 addition & 1 deletion App/SyringePump.Design/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SyringePump.Design"
x:Class="SyringePump.App"
Name="SyringePump">
Name="Syringe Pump">
<Application.DataTemplates>
<local:ViewLocator/>
</Application.DataTemplates>
Expand Down
2 changes: 1 addition & 1 deletion App/SyringePump.Design/SyringePump.Design.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<AssemblyName>SyringePump.Design</AssemblyName>
<Version>1.0</Version>
<Version>1.0.1</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>..\bin\Debug\</OutputPath>
Expand Down
3 changes: 2 additions & 1 deletion App/SyringePump.Design/ViewModels/SyringePumpViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ private IObservable<Unit> ConnectAndGetBaseInfo()
Log.Information("Connection established with the following return information: {Info}", configuration);

// present messagebox if we are not handling a Pump device
if (configuration.WhoAmI != 1280)
// NOTE: this is temporary and in the next version we will remove support for the older ID (1280)
if (configuration.WhoAmI != 1296 && configuration.WhoAmI != 1280)
{
// when the configuration.WhoAmI is zero, we are dealing with a non-HARP device, so change message accordingly
var message = $"Found a HARP device: {configuration.DeviceName} ({configuration.WhoAmI}).\n\nThis GUI is only for the SyringePump HARP device.\n\nPlease select another serial port.";
Expand Down
Binary file modified App/SyringePump.nsi
Binary file not shown.
9 changes: 9 additions & 0 deletions App/SyringePump/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Packaging.Targets">
<Version>0.1.220-*</Version>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>
5 changes: 3 additions & 2 deletions App/SyringePump/SyringePump.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<Nullable>enable</Nullable>
<UseAppHost>true</UseAppHost>
<!--Avalonia doesen't support TrimMode=link currently,but we are working on that https://github.com/AvaloniaUI/Avalonia/issues/6892 -->
<TrimMode>copyused</TrimMode>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<AssemblyName>SyringePump</AssemblyName>
<BaseOutputPath>..\bin</BaseOutputPath>
<Version>1.0</Version>
<Version>1.0.1</Version>
</PropertyGroup>
<PropertyGroup>
<CFBundleName>SyringePump</CFBundleName>
Expand Down
4 changes: 2 additions & 2 deletions Firmware/Pump/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ void hwbp_app_initialize(void)
uint8_t hwH = 1;
uint8_t hwL = 1;
uint8_t fwH = 0;
uint8_t fwL = 5;
uint8_t fwL = 6;
uint8_t ass = 0;

/* Start core */
core_func_start_core(
1280,
1296,
hwH, hwL,
fwH, fwL,
ass,
Expand Down

0 comments on commit 93b078d

Please sign in to comment.