Skip to content

Commit

Permalink
v2.5.5.0 (18 June, 2018)
Browse files Browse the repository at this point in the history
* Change: Read from api count one for current glucose
  • Loading branch information
Matze1985 committed Jun 18, 2018
1 parent bc7acb5 commit c7598f0
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
28 changes: 16 additions & 12 deletions GlucoTT.au3
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#AutoIt3Wrapper_Icon=Icon.ico
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_Description=A simple discrete glucose tooltip for Nightscout under Windows
#AutoIt3Wrapper_Res_Fileversion=2.5.0.0
#AutoIt3Wrapper_Res_Fileversion=2.5.5.0
#AutoIt3Wrapper_Res_LegalCopyright=Mathias Noack
#AutoIt3Wrapper_Res_Language=1031
#AutoIt3Wrapper_Run_Tidy=y
Expand Down Expand Up @@ -105,7 +105,7 @@ Func _Restart()
EndFunc

; API-Pages
Local $sPageCurrent = "/api/v1/entries/current"
Local $sPageCountCurrent = "/api/v1/entries/sgv?count=1"
Local $sPageCount = "/api/v1/entries/sgv?count=2"
Local $sPageJsonState = "/api/v1/status.json"

Expand All @@ -122,31 +122,33 @@ Func _Tooltip()
Local $sWrongMsg = ""

; Make a SimpleSSL request
Local $hRequestPageCurrentSSL = _WinHttpSimpleSendSSLRequest($hConnect, Default, $sPageCurrent)
Local $hRequestPageCountCurrentSSL = _WinHttpSimpleSendSSLRequest($hConnect, Default, $sPageCountCurrent)
Local $hRequestPageCountSSL = _WinHttpSimpleSendSSLRequest($hConnect, Default, $sPageCount)
Local $hRequestPageJsonStateSSL = _WinHttpSimpleSendSSLRequest($hConnect, Default, $sPageJsonState)

; Read RequestSSL
Local $sReturnedPageCurrent = _WinHttpSimpleReadData($hRequestPageCurrentSSL)
Local $sReturnedPageCountCurrent = _WinHttpSimpleReadData($hRequestPageCountCurrentSSL)
If Not @Compiled Then ConsoleWrite("@@ Debug(" & @ScriptLineNumber & ") :" & " 1st line : " & $sReturnedPageCountCurrent & @CRLF)
Local $sReturnedPageCount = _WinHttpSimpleReadData($hRequestPageCountSSL)
Local $sReturnedPageJsonState = _WinHttpSimpleReadData($hRequestPageJsonStateSSL)

; Match result variables from page
Local $sSecondTextLine = StringReplace($sReturnedPageCount, $sReturnedPageCurrent, "")
Local $sSecondTextLine = StringReplace($sReturnedPageCount, $sReturnedPageCountCurrent, "")
If Not @Compiled Then ConsoleWrite("@@ Debug(" & @ScriptLineNumber & ") :" & " 2nd line : " & $sSecondTextLine)
Local $sCountMatch = "([0-9]{13})|([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}\+[0-9]{4})|([ ])|(openLibreReader-ios-blueReader-[0-9])|(xDrip-DexcomG[0-9])"
Local $sText = StringRegExpReplace($sReturnedPageCurrent, $sCountMatch, " ")
Local $sText = StringRegExpReplace($sReturnedPageCountCurrent, $sCountMatch, " ")
Local $sLastText = StringRegExpReplace($sSecondTextLine, $sCountMatch, " ")
Local $iGlucose = Int(StringRegExpReplace($sText, "[^0-9]+", ""))
If Not @Compiled Then ConsoleWrite("@@ Debug(" & @ScriptLineNumber & ") :" & " Glucose : " & $iGlucose & @CRLF)
Local $iLastGlucose = Int(StringRegExpReplace($sLastText, "[^0-9]+", ""))

; Check time readings
Local $iYear = Int(StringLeft($sReturnedPageCurrent, 4))
Local $iMonth = Int(StringMid($sReturnedPageCurrent, 6, 2))
Local $iDay = Int(StringMid($sReturnedPageCurrent, 9, 2))
Local $iHour = Int(StringMid($sReturnedPageCurrent, 12, 2))
Local $iMin = Int(StringMid($sReturnedPageCurrent, 15, 2))
Local $iSec = Int(StringMid($sReturnedPageCurrent, 18, 2))
Local $iYear = Int(StringLeft($sReturnedPageCountCurrent, 4))
Local $iMonth = Int(StringMid($sReturnedPageCountCurrent, 6, 2))
Local $iDay = Int(StringMid($sReturnedPageCountCurrent, 9, 2))
Local $iHour = Int(StringMid($sReturnedPageCountCurrent, 12, 2))
Local $iMin = Int(StringMid($sReturnedPageCountCurrent, 15, 2))
Local $iSec = Int(StringMid($sReturnedPageCountCurrent, 18, 2))
Local $sLastYearMonthDayHourMinSec = $iYear & "/" & $iMonth & "/" & $iDay & " " & $iHour & ":" & $iMin & ":" & $iSec
If Not @Compiled Then ConsoleWrite("@@ Debug(" & @ScriptLineNumber & ") :" & " Last time on server: " & $sLastYearMonthDayHourMinSec & @CRLF)
Local $sCurrentYearMonthDayHourMinSec = @YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC
Expand Down Expand Up @@ -285,6 +287,8 @@ Func _Tooltip()
Local $iCheckGlucose = StringRegExp($iGlucose, '^([0-9]{1,3})')
; Check values for mmol or mg/dl
Local $iCheckReadOptionValues = StringRegExp($sReadOption, '(mmol|mg\/dl)')

; Tooltip
If $iCheckReadOptionValues <> 1 Or $iCheckGlucose <> 1 Or $iCheckInet <> 1 Then
ToolTip($sWrongMsg, @DesktopWidth - $sInputDesktopWidth, @DesktopHeight - $sInputDesktophHeight, $sWrongMsg, 3, 2)
Else
Expand Down
Binary file modified GlucoTT.exe
Binary file not shown.
Binary file added Screenshots/Example_5.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion Update/ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
ChangeLog

Summarized history of the changes:
v2.5.5.0 (18 June, 2018)
Change: Read from api count one for current glucose

v2.5.0.0 (16 June, 2018)
Change: Bugfixes
Change: Fix for sorting error (for reading glucose)
Expand Down Expand Up @@ -50,7 +53,7 @@ v1.6.0.0 (10 March, 2018)
Added: Last reading in minutes, showing in tooltip

v1.5.0.0 (01 March, 2018)
Added: User-friendly settings (Open file after error, after closing, the app restarts
Added: User-friendly settings (Open file after error, after closing, the app restarts)
Added: Entry "Settings" in TrayMenu

v1.4.5.0 (25 February, 2018)
Expand Down
8 changes: 4 additions & 4 deletions Update/CheckUpdate.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[GlucoTT.exe]
version=2.5.0.0
date=2018/06/16 15:07
Filesize=1162752
CRC=B5166E4F
version=2.5.5.0
date=2018/06/18 18:34
Filesize=1163264
CRC=802A4EFC
download=https://github.com/Matze1985/GlucoTT/raw/master/GlucoTT.exe
changes=https://raw.githubusercontent.com/Matze1985/GlucoTT/master/Update/ChangeLog.txt

0 comments on commit c7598f0

Please sign in to comment.