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
// The following sample code uses modern ECMAScript 6 features | |
// that aren't supported in Internet Explorer 11. | |
// To convert the sample for environments that do not support ECMAScript 6, | |
// such as Internet Explorer 11, use a transpiler such as | |
// Babel at http://babeljs.io/. | |
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | |
return new (P || (P = Promise))(function (resolve, reject) { | |
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | |
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | |
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } |
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
{ | |
"name": "Pi MonitR Client", | |
"version": "1.0", | |
"description": "Real time Streaming from Raspnerry PI using SignalR", | |
"browser_action": { | |
"default_popup": "popup.html", | |
"default_icon": { | |
"16": "images/16.png", | |
"32": "images/32.png", | |
"48": "images/48.png", |
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
public class PiCameraService | |
{ | |
public MMALCamera MMALCamera; | |
private readonly string picStoragePath = "/home/pi/images/"; | |
private readonly string picExtension = "jpg"; | |
public PiCameraService() | |
{ | |
MMALCamera = MMALCamera.Instance; | |
//Setting the Average resolution for reducing the file size | |
MMALCameraConfig.StillResolution = new Resolution(640, 480); |
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
public class FaceClientCognitiveService | |
{ | |
private readonly IFaceClient faceClient; | |
private readonly float scoreLimit = 0.5f; | |
private readonly ILogger<FaceClientCognitiveService> _logger; | |
public FaceClientCognitiveService(IConfiguration config, ILogger<FaceClientCognitiveService> logger) | |
{ | |
_logger = logger; | |
faceClient = new FaceClient(new ApiKeyServiceClientCredentials(config["SubscriptionKey"]), | |
new System.Net.Http.DelegatingHandler[] { }); |
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
internal class PiMonitRWorker : BackgroundService | |
{ | |
private readonly IHubContext<PiMonitRHub> _piMonitRHub; | |
private readonly PiCameraService _piCameraService; | |
private readonly FaceClientCognitiveService _faceClientCognitiveService; | |
public PiMonitRWorker(IHubContext<PiMonitRHub> piMonitRHub, | |
PiCameraService piCameraService, FaceClientCognitiveService faceClientCognitiveService) | |
{ | |
_piMonitRHub = piMonitRHub; | |
_piCameraService = piCameraService; |
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
public class PiMonitRHub : Hub | |
{ | |
internal static bool _isStreamRunning = false; | |
private readonly PiCameraService _piCameraService; | |
public PiMonitRHub(PiCameraService piCameraService) | |
{ | |
_piCameraService = piCameraService; | |
} | |
public ChannelReader<object> StartStream(CancellationToken cancellationToken) |
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
public class SomeEntity | |
{ | |
public object this[string propertyName] | |
{ | |
get | |
{ | |
// get value of property named propertyName | |
} | |
set |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Http; | |
namespace Angular7DemoServices | |
{ | |
// You may need to install the Microsoft.AspNetCore.Http.Abstractions package into your project |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Angular7DemoServices; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.Extensions.Configuration; |