Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Now for the othher watches :
- Samsung Galaxy Watch Active : Yes. (confirmed by others)
- Samsung Galaxy Watch Active 2 : Yes. (confirmed by others)
- Samsung Gear Sport : Yes. (confirmed by @ikemarx)
- Samsung Gear S3 : Must be compatible too.
- Samsung Gear S3 : Yes (confirmed by @barkermn01)
- Samsung Gear S2 : Must be compatible too.
- Samsung Gear S : I don't know at all.
- Samsung Galaxy Fit(e) : Since there is no app store, no.
Expand Down
7 changes: 4 additions & 3 deletions csharp-project/HeartRateServer/HeartRateServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ private void StopListener()
}

public String HandleGETRequest(String page) {

TextReader tr = new StreamReader(page);
return tr.ReadToEnd(); //getting the page's content

String content = tr.ReadToEnd(); //getting the page's content
tr.Close();
return content;
}

public String HandlePOSTRequest(HttpListenerContext context)
Expand All @@ -232,6 +232,7 @@ public String HandlePOSTRequest(HttpListenerContext context)
using (StreamWriter file = new StreamWriter(@"./www/hr.txt", false))
{
file.WriteLine(hr);
file.Close();
}

return "OK"; // answer provided to the smart watch for an "ack"
Expand Down
1 change: 1 addition & 0 deletions csharp-project/HeartRateToWeb/HeartRateToWeb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
<ApplicationIcon>logo-app.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion csharp-project/HeartRateToWeb/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:local="clr-namespace:HeartRateToWeb"
mc:Ignorable="d"
Title="HeartRateToWeb" Height="338" Width="615"
ResizeMode="NoResize">
ResizeMode="CanMinimize">
<Grid Name="Receiver">

<Grid.RowDefinitions>
Expand Down
76 changes: 76 additions & 0 deletions csharp-project/HeartRateToWeb/app.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel element will disable file and registry virtualization.
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->

<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->

<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->

<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->

<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->

<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->

</application>
</compatibility>

<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
-->

<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->

</assembly>
91 changes: 72 additions & 19 deletions obs-html-files/css/style.css
Original file line number Diff line number Diff line change
@@ -1,36 +1,89 @@

progress{
width: 1200px;
width: 100%;
height: 50px;
}
.text{
color: #acacac;
font-family: Calibri, sans-serif;
}
#HR_NUMBER, #HR_BPM_WORD{
font-size: 80px;
}
#HR_LAST_UPDATE{
font-size: 50px;
}
#HR_STATE{
font-size: 60px;
.text {
position: absolute;
font-size: 45px;
margin-top: -3px;
margin-left: 17px;
color: red;
text-shadow: 2px 2px #ecb4b4;
font-family: 'Legend M54';
width: 100%;
text-align: center;
}

progress {
border: 0;
background: #eee;
border-radius: 100px;
appearance: none;
}

progress::-webkit-progress-bar {
background: #eee;
border-radius: 100px;
background: rgba(0,0,0,0);
border-radius: 10px;
box-shadow:inset 0px -2px 5px rgba(0, 0, 0, 0.2);
}

progress::-webkit-progress-value {
border-radius: 100px 0 0 100px;
border-radius: 10px 10px 10px 10px;
/*background-color: #d93232;*/
background-color: green;
}
background: linear-gradient(to left, red 0%, yellow 50%, green 100%) left/var(--p,100%) fixed;
box-shadow:inset 0px -2px 5px rgba(0, 0, 0, 0.2);
}

@keyframes heartbeat {
0% {
transform: scale( .75);
}
20% {
transform: scale( 1);
}
40% {
transform: scale( .75);
}
60% {
transform: scale( 1);
}
80% {
transform: scale( .75);
}
100% {
transform: scale( .75);
}
}

#heart {
position: absolute;
width: 100px;
height: 90px;
animation: heartbeat 1s infinite;
zoom: 0.5;
left: 50%;
right: 50%;
margin-left: -258px;
margin-top: 15px;
}

#heart:before,
#heart:after {
position: absolute;
content: "";
left: 50px;
top: 0;
width: 50px;
height: 80px;
background: red;
-moz-border-radius: 50px 50px 0 0;
border-radius: 50px 50px 0 0;
transform: rotate(-45deg);
transform-origin: 0 100%;
}

#heart:after {
left: 0;
transform: rotate(45deg);
transform-origin: 100% 100%;
}
59 changes: 30 additions & 29 deletions obs-html-files/obs.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,52 @@
<body>

<div class="text">
<span id="HR_NUMBER">000</span> - <span id="HR_BPM_WORD">bpm</span> -
<span id="HR_LAST_UPDATE">00:00:00</span> - <span id="HR_STATE"></span> - <span>loic2665</span>
<div id="heart"></div><span id="HR_NUMBER">000</span><span id="HR_BPM_WORD">bpm</span>
</div>
<div>
<progress id="HR_PROGRESS" value="50" max="180"></progress>
<progress id="HR_PROGRESS" value="50" min="20" max="170"></progress>
</div>

<script type="text/javascript" src="./js/jquery-3.5.1.min.js"></script>
<script>

function updateTextStyle(result) {

if (result < 100) {
$("#HR_BPM_WORD").css({"display":"inline"});
$("#heart").css({"display":"block"});

if(result < 70){
$("#heart").css({"animation":"heartbeat 1.5s infinite"});
}
if(result > 70 && result < 100){
$("#heart").css({"animation":"heartbeat 1s infinite"});
}
if(result > 100 && result < 130){
$("#heart").css({"animation":"heartbeat 0.7s infinite"});
}
if(result > 130 && result < 170){
$("#heart").css({"animation":"heartbeat 0.5s infinite"});
}
if(result > 170){
$("#heart").css({"animation":"heartbeat 0.2s infinite"});
}
if (result < 10) {
result = "Not Available";
$("#heart").css({"display":"none"});
$("#HR_BPM_WORD").css({"display":"none"});
}
if (result < 100) {
result = "0" + result;
}
$("#HR_NUMBER").text(result);


$("#HR_LAST_UPDATE").text(new Date().toLocaleTimeString());
//$("#HR_LAST_UPDATE").text(new Date().toLocaleTimeString());

var STATUS = "";

if(result <= 0){
/*if(result <= 0){
STATUS = "Problème de lecture ?";
}else if(result > 0 && result <= 65){
STATUS = "Boh, relax !";
}else if(result > 65 && result <= 80){
STATUS = "On est bien !";
}else if(result > 80 && result <= 90){
STATUS = "On bouge un peu... !";
}else if(result > 90 && result <= 100){
STATUS = "On bouge !";
}else if(result > 100 && result <= 110){
STATUS = "On bouge bien là !";
}else if(result > 110 && result <= 130){
STATUS = "On bouge bien fort là !";
}else if(result > 130 && result <= 140){
STATUS = "Wow ! Sympa l'activité !";
}else if(result > 140 && result <= 160){
STATUS = "Ca commence à faire beaucoup là...";
}else if(result > 160 && result <= 180){
STATUS = "Ouch, pas bon signe ça...";
}else{
STATUS = "Appellez une ambulance svp";
}
}*/

$("#HR_STATE").text(STATUS);

Expand All @@ -69,7 +70,7 @@
$.ajax({
type: "GET",
crossDomain: true,
url: "http://localhost:6547/hr",
url: "http://localhost:6547/hr.txt",
success: updateProgessBar,
async: false
});
Expand Down