-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made working SignalR hub on the server + connection on Construct Studio
- Loading branch information
Showing
31 changed files
with
3,199 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
Construct3/Construct3/Construct.Server.Models.Data/OwinSignalRConfigurator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Owin; | ||
|
||
namespace Construct.Server.Models.Data | ||
{ | ||
class Startup | ||
{ | ||
public void Configuration(IAppBuilder app) | ||
{ | ||
app.MapSignalR(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
Construct3/Construct3/Construct.Server.Runtime.WindowsUX/packages.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Microsoft.Owin.Host.HttpListener" version="3.0.0" targetFramework="net45" /> | ||
<package id="NLog" version="3.1.0.0" targetFramework="net40" requireReinstallation="True" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
Construct3/Construct3/Construct.Server.Services.Data/packages.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Microsoft.Owin.Host.HttpListener" version="3.0.0" targetFramework="net45" /> | ||
<package id="NLog" version="3.1.0.0" targetFramework="net40" requireReinstallation="True" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
Construct3/Construct3/Construct.UX.Views.Visualizations/IStreamDataSource.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Construct.UX.Views.Visualizations | ||
{ | ||
interface IStreamDataSource | ||
{ | ||
// Property ID / Source ID / Data | ||
event Action<String, String, object> OnData; | ||
|
||
void Start(); | ||
void Stop(); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
Construct3/Construct3/Construct.UX.Views.Visualizations/SignalRStreamDataSource.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Construct.UX.ViewModels.Visualizations.VisualizationsServiceReference; | ||
using Microsoft.AspNet.SignalR.Client; | ||
|
||
namespace Construct.UX.Views.Visualizations | ||
{ | ||
// Intended to connect only to Construct-hosted SigR hub | ||
class SignalRStreamDataSource : IStreamDataSource | ||
{ | ||
public event Action<String, String, object> OnData; | ||
|
||
public String SourceHostName { get; private set; } | ||
public String DataUri { get; private set; } | ||
|
||
private HubConnection hubConnection; | ||
|
||
public SignalRStreamDataSource(String dataHostname) | ||
{ | ||
SourceHostName = dataHostname; | ||
DataUri = "http://" + SourceHostName + ":15999/00000000-0000-0000-0000-000000000000/Data"; | ||
|
||
hubConnection = new HubConnection(DataUri); | ||
IHubProxy dataProxy = hubConnection.CreateHubProxy("ItemStreamHub"); | ||
dataProxy.On<string, string, double>("newData", DispatchData); | ||
} | ||
|
||
public void Start() | ||
{ | ||
hubConnection.Start(); | ||
} | ||
|
||
public void Stop() | ||
{ | ||
hubConnection.Stop(); | ||
} | ||
|
||
private void DispatchData(String propertyName, String sourceName, double data) | ||
{ | ||
|
||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
Construct3/Construct3/Construct.UX.Views.Visualizations/StreamDataRouter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Construct.UX.Views.Visualizations | ||
{ | ||
class StreamDataRouter | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
Construct3/Construct3/Construct.UX.Views.Visualizations/packages.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Microsoft.AspNet.SignalR.Client" version="2.1.2" targetFramework="net45" /> | ||
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" /> | ||
</packages> |
Binary file added
BIN
+189 KB
...ackages/Microsoft.AspNet.SignalR.Client.2.1.2/Microsoft.AspNet.SignalR.Client.2.1.2.nupkg
Binary file not shown.
Oops, something went wrong.