Moving the serial port out of .net standard lib
This commit is contained in:
parent
9f89d7a4c0
commit
325faf7001
7 changed files with 20 additions and 4 deletions
|
|
@ -129,6 +129,11 @@ namespace MatterHackers.SerialPortCommunication.FrostedSerial
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// given a serialPortName return a IFrostedSerialPort compatible with the system
|
||||
/// </summary>
|
||||
public static Func<string, IFrostedSerialPort> GetPlatformSerialPort;
|
||||
|
||||
public virtual IFrostedSerialPort Create(string serialPortName)
|
||||
{
|
||||
#if __ANDROID__
|
||||
|
|
@ -147,7 +152,7 @@ namespace MatterHackers.SerialPortCommunication.FrostedSerial
|
|||
}
|
||||
else // use the c# native serial port
|
||||
{
|
||||
newPort = new CSharpSerialPortWrapper(serialPortName);
|
||||
newPort = GetPlatformSerialPort(serialPortName);
|
||||
}
|
||||
|
||||
return newPort;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Win32.Registry" Version="4.5.0" />
|
||||
<PackageReference Include="System.IO.Ports" Version="4.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@
|
|||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CSharpSerialPortWrapper.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
|
|
@ -63,6 +64,10 @@
|
|||
<Project>{f1653f20-d47d-4f29-8c55-3c835542af5f}</Project>
|
||||
<Name>Community.CsharpSqlite</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="MatterControl.Printing\MatterControl.Printing.csproj">
|
||||
<Project>{97d5ade3-c1b4-4b46-8a3e-718a4f7f079f}</Project>
|
||||
<Name>MatterControl.Printing</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="MatterControlLib\MatterControlLib.csproj">
|
||||
<Project>{93bebfdf-b81a-4344-ab82-0dbf58b234cd}</Project>
|
||||
<Name>MatterControlLib</Name>
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ using System.Threading;
|
|||
using MatterHackers.Agg.Platform;
|
||||
using MatterHackers.MatterControl.DataStorage;
|
||||
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
using MatterHackers.SerialPortCommunication.FrostedSerial;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace MatterHackers.MatterControl
|
||||
|
|
@ -47,6 +48,12 @@ namespace MatterHackers.MatterControl
|
|||
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture;
|
||||
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;
|
||||
|
||||
// make sure we can bulid a system relevant serial port
|
||||
FrostedSerialPortFactory.GetPlatformSerialPort = (serialPortName) =>
|
||||
{
|
||||
return new CSharpSerialPortWrapper(serialPortName);
|
||||
};
|
||||
|
||||
// and make sure the app is set correctly
|
||||
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
|
||||
Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit aca5a98d0d4cc83a9bd83d465c55540df5becc8c
|
||||
Subproject commit ee48276540d35a0b192206f3ce61e360b7bf07c7
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit cb3ed414672de4b8d1fddc136f05930050a14c61
|
||||
Subproject commit 721ec70bd37432a0f1aade5109b4eb2cea34a6bd
|
||||
Loading…
Add table
Add a link
Reference in a new issue