Made MatterControl run as a .net standard app
Moving matter control to a lib and creating a new exe to run it
This commit is contained in:
parent
8b4790e493
commit
bed90234e7
485 changed files with 283 additions and 571 deletions
|
|
@ -0,0 +1,25 @@
|
|||
using System.Net;
|
||||
using MatterHackers.MatterControl;
|
||||
using MatterHackers.MatterControl.SlicerConfiguration;
|
||||
using MatterHackers.SerialPortCommunication.FrostedSerial;
|
||||
|
||||
namespace TcpipDriver
|
||||
{
|
||||
public class TcpipSerialPortFactory : FrostedSerialPortFactory
|
||||
{
|
||||
public override bool SerialPortAlreadyOpen(string portName) => false;
|
||||
|
||||
protected override string GetDriverType() => "TCPIP";
|
||||
|
||||
public override IFrostedSerialPort Create(string serialPortName)
|
||||
{
|
||||
return new TcpipSerialPort(ApplicationController.Instance.ActivePrinter.Connection, serialPortName);
|
||||
}
|
||||
|
||||
public override bool SerialPortIsAvailable(string serialPortName)
|
||||
{
|
||||
return int.TryParse(ActiveSliceSettings.Instance.GetValue(SettingsKey.ip_port), out _)
|
||||
&& IPAddress.TryParse(ActiveSliceSettings.Instance.GetValue(SettingsKey.ip_address), out _);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue