From 6c895115dc4011b66e674bb57f282b2e6f2049a9 Mon Sep 17 00:00:00 2001 From: Martin Barker Date: Sat, 5 Jun 2021 15:29:46 +0100 Subject: [PATCH 1/4] Updated to fix FileLock Problems, so was not updating the hr.txt because of rouge file lock --- csharp-project/HeartRateServer/HeartRateServer.cs | 7 ++++--- csharp-project/HeartRateToWeb/HeartRateToWeb.csproj | 1 + csharp-project/HeartRateToWeb/MainWindow.xaml | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/csharp-project/HeartRateServer/HeartRateServer.cs b/csharp-project/HeartRateServer/HeartRateServer.cs index 0ae5e76..65031a1 100644 --- a/csharp-project/HeartRateServer/HeartRateServer.cs +++ b/csharp-project/HeartRateServer/HeartRateServer.cs @@ -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) @@ -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" diff --git a/csharp-project/HeartRateToWeb/HeartRateToWeb.csproj b/csharp-project/HeartRateToWeb/HeartRateToWeb.csproj index c5d3316..ebdd066 100644 --- a/csharp-project/HeartRateToWeb/HeartRateToWeb.csproj +++ b/csharp-project/HeartRateToWeb/HeartRateToWeb.csproj @@ -5,6 +5,7 @@ netcoreapp3.1 true logo-app.ico + app.manifest diff --git a/csharp-project/HeartRateToWeb/MainWindow.xaml b/csharp-project/HeartRateToWeb/MainWindow.xaml index 1a1c5a7..fdef8e5 100644 --- a/csharp-project/HeartRateToWeb/MainWindow.xaml +++ b/csharp-project/HeartRateToWeb/MainWindow.xaml @@ -6,7 +6,7 @@ xmlns:local="clr-namespace:HeartRateToWeb" mc:Ignorable="d" Title="HeartRateToWeb" Height="338" Width="615" - ResizeMode="NoResize"> + ResizeMode="CanMinimize"> From d15dad048f4e434f83d1b35e3d482bf2b56c5af5 Mon Sep 17 00:00:00 2001 From: Martin Barker Date: Sat, 5 Jun 2021 15:30:52 +0100 Subject: [PATCH 2/4] added app manifest that forces application to run as admin --- csharp-project/HeartRateToWeb/app.manifest | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 csharp-project/HeartRateToWeb/app.manifest diff --git a/csharp-project/HeartRateToWeb/app.manifest b/csharp-project/HeartRateToWeb/app.manifest new file mode 100644 index 0000000..d72e750 --- /dev/null +++ b/csharp-project/HeartRateToWeb/app.manifest @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 83bd93015f47f949f0656dbdec58de80d3de0f67 Mon Sep 17 00:00:00 2001 From: Martin Barker Date: Sat, 5 Jun 2021 15:34:53 +0100 Subject: [PATCH 3/4] updated readme to confirm this works on Gear S3 watch --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 93c81b6..c34acb9 100644 --- a/README.md +++ b/README.md @@ -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. From b36ba8daefcf5f8b642a9df34c728963d929e055 Mon Sep 17 00:00:00 2001 From: Martin Barker Date: Sat, 5 Jun 2021 15:39:14 +0100 Subject: [PATCH 4/4] updated HTML to have a little animation inside it also added made it work better with BrowserSource in OBS so it is always 100% witch, couple of color changes an an example --- obs-html-files/css/style.css | 91 ++++++++++++++++++++++++++++-------- obs-html-files/obs.html | 59 +++++++++++------------ 2 files changed, 102 insertions(+), 48 deletions(-) diff --git a/obs-html-files/css/style.css b/obs-html-files/css/style.css index f475436..53d5644 100644 --- a/obs-html-files/css/style.css +++ b/obs-html-files/css/style.css @@ -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; -} \ No newline at end of file + 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%; +} diff --git a/obs-html-files/obs.html b/obs-html-files/obs.html index a24a648..1b9cf9c 100644 --- a/obs-html-files/obs.html +++ b/obs-html-files/obs.html @@ -7,51 +7,52 @@
- 000 - bpm - - 00:00:00 - - loic2665 +
000bpm
- +