Skip to content

Commit

Permalink
Documentation updated
Browse files Browse the repository at this point in the history
  • Loading branch information
haniibrahim committed Oct 2, 2018
1 parent 148a259 commit 56c98d8
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 24 deletions.
40 changes: 40 additions & 0 deletions Notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Notes for SerialLogger

## Timestamp function
SerialLogger offers since v1.1.0 a timestamp function which add a timestamp in front of every data line. The user can choose from a lot of predefined formats. Furthermore the user can choose from a couple delimiter signs which separate the timestamp components and the data from each other. This makes it easier to import the data to post-processing applications.

### Delimiter signs
The delimiter sign is added between timestamp components (if necessary) and at the end of the timestamp just before the data
- blank (*space character*)
- comma (,)
- semicolon (;)

### Timestamp formats
- *ISO 8601:*
Format: ```2018-09-06T13:45:42+0200``` => 1:45:42pm at September 6th, 2018 CEST (Central European Summer Time)
- *Date|Time|Timezone:*
Format: ```06.09.2016,13:45:42,+0200``` => 1:45:42pm at September 6th, 2018 CEST, comma is the delimiter
- *Date|Time:*
Format: ```06.09.2016,13:45:42``` => 1:45:42pm at September 6th, 2018, comma is the delimiter
- *Time:*
Format: ```13:45:42``` => 1:45:42pm
- *Mod. Julian Day:* The Modified Julian Day (MJD) is an abbreviated version of the old Julian Day (JD) dating method
which has been in use for centuries by astronomers, geophysicists, chronologers, and others who needed to have an
unambiguous dating system based on continuing day counts. MJD counts days from November 17, 1858 onwards and starts,
in comparison to the JD, at midnight. Time is displayed as a fraction of a day. It is easy to calculate time differences.
Format: ```58393.431814675925``` => 10:21:48am at October 2nd, 2018 CEST
- *Year|Day of year|Time:* The Day of the year is the counted day from Jan. 1st = 1 onwards till 365 or 366 resp. This
Format: ```2018 275 10:21:48``` => 10:21:48am at October 2nd, 2018, [blank] is the delimiter
- *Year|month|day|hours|minutes|seconds|timezone:* This timestamp offers all standard date and time components in
sepratate fields for easier post-processing handling
Format: ```2018 10 2 10 21 48 +0200``` => => 10:21:48am at October 2nd, 2018 CEST, [blank] is the delimiter

## Settings storage
*WINDOWS:* Settings are stored in the regitry (regedit.exe) in the key:
```Computer\HKEY_CURRENT_USER\Software\JavaSoft\Prefs\de\haniibrahim\seriallogger```

*UNIX, GNU/Linux:* Settings are stored in user's home directory in the file:
```~/.java/.userPrefs/de/haniibrahim/seriallogger/prefs.xml```

*macOS:* Settings are stored in user's library directory in the file:
```~/Library/Preferences/de.haniibrahim.seriallogger.plist```
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* Hardware (CTS/RTS) and Software (Xon/Xoff) handshake available

## Screenshot
![](http://blog.hani-ibrahim.de/wp-content/uploads/seriallogger-1.0.0-beta_windows.png "Screenshot")
![](http://blog.hani-ibrahim.de/wp-content/uploads/Seriallogger-1.1.0-alpha.png "Screenshot")

SerialLogger v1.0.0 on Windows 10
SerialLogger v1.1.0-alpha on Windows 10

## Requirements

Expand Down Expand Up @@ -47,6 +47,7 @@ For JARs and platform related installers go to the [RELEASE](https://github.com/
| 0.9.0 | Basic logging functions and serial settings, fail-proof log file feature, full cross-platform functionality (Windows, macOS, GNU/Linux) |
| 1.0.0-beta | Hardware (CTS/RTS) and Software (Xon/Xoff) flowcontrol option, append data to existing file feature, invalid path bug fixed, warning of overwriting unsaved/unlogged buffer at new connections|
| 1.0.0 | Check & warn for unsaved/unlogged puffer at app closing, empty commport bug fixed, flowcontrol bug fixed, filedialog bug fixed on macOS & Windows, code clean-up |
| 1.1.0-alpha | Timestamp feature |

## Roadmap

Expand Down
2 changes: 1 addition & 1 deletion To-Do.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
[x] Get rid of the cosmetic "Empty Commport" GUI bug
[x] Warning when close window/quit app and buffer is not empty and not logged.
[x] Flowcontrol bug fixed
[ ] Timestamp feature
[x] Timestamp feature
[ ] Save option for buffer
[ ] CLI interface
51 changes: 30 additions & 21 deletions de/haniibrahim/seriallogger/Helper.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ static String getOS() {
}

/**
* Return a timestamp in ISO 8601, format: yyyy-MM-dd'T'HH:mm:ssZ, delimiter
Example: 2018-09-06T13:45:42+0200 1:45:42pm at September 6th, 2018 CEST
(Central European Summer Time)
*
* Return a timestamp in ISO 8601, format: yyyy-MM-dd'T'HH:mm:ssZ, delimiter
*
* Example: 2018-09-06T13:45:42+0200 1:45:42pm at September 6th, 2018 CEST
* (Central European Summer Time)
*
* @param delimiter Separator sign (e.g. [blank],[,],[;])
* @return ISO 8601 timestamp
*/
static String getIsoTimestamp(String delimiter) {
Expand All @@ -62,13 +63,13 @@ static String getIsoTimestamp(String delimiter) {
}

/**
* Return a timestamp formated as date, sepearator, time, delimiter
timezone, delimiter
This format is excellent to process data in spreadsheets apps
Example: 06.09.2016,13:45:42,+0200 1:45:42pm at September 6th, 2018 CEST,
comma is the delimiter
* Return a timestamp formated as date, sepearator, time, delimiter
* timezone, delimiter
*
* This format is excellent to process data in spreadsheets apps
*
* Example: 06.09.2016,13:45:42,+0200
* 1:45:42pm at September 6th, 2018 CEST, comma is the delimiter
*
* @param delimiter Separator sign (e.g. [blank],[,],[;])
* @return date/delimiter/time timestamp
Expand All @@ -86,11 +87,11 @@ static String getDateTimeTz(String delimiter) {

/**
* Return a timestamp formated as date, sepearator, time, delimiter
This format is excellent to process data in spreadsheets apps
Example: 06.09.2016,13:45:42 1:45:42pm at September 6th, 2018, comma is
the delimiter
*
* This format is excellent to process data in spreadsheets apps
*
* Example: 06.09.2016,13:45:42
* 1:45:42pm at September 6th, 2018, comma is the delimiter
*
* @param delimiter Separator sign (e.g. [blank],[,],[;])
* @return date/delimiter/time timestamp
Expand All @@ -107,7 +108,7 @@ static String getDateTimeTimestamp(String delimiter) {
* This format is excellent to process data in spreadsheets apps
*
* Example: 13:45:42
* 1:45:42pm at September 6th, 2018
* 1:45:42pm
*
* @param delimiter Separator sign (e.g. [blank],[,],[;])
* @return date/delimiter/time timestamp
Expand All @@ -124,7 +125,7 @@ static String getTimeTimestamp(String delimiter) {
* 1:45:42pm at September 6th, 2018 (day 249 of 2018)
*
* @param delimiter Separator sign (e.g. [blank],[,],[;])
* @return
* @return day of the year timestamp
*/
static String getDayOfYearTimestamp(String delimiter){
Calendar cal = Calendar.getInstance(); // get current date and time
Expand All @@ -135,7 +136,15 @@ static String getDayOfYearTimestamp(String delimiter){
+ Integer.toString(cal.get(Calendar.SECOND))
+ delimiter;
}

/**
* Return timestamp in seperate date and time components incl. timezone
*
* Example: 2018 10 2 10 21 48 +0200
* 10:21:48am at October 2nd, 2018 CEST, [blank] is the delimiter
*
* @param delimiter Separator sign (e.g. [blank],[,],[;])
* @return Year|month|day|hours|minutes|seconds|timezone timestamp
*/
static String getYMDhmsTz(String delimiter){
Calendar cal = Calendar.getInstance(); // get current date and time

Expand All @@ -157,7 +166,7 @@ static String getYMDhmsTz(String delimiter){
* Returns timestamp as modified Julian Date including time as floating point
*
* @param delimiter Separator sign (e.g. [blank],[,],[;])
* @return
* @return Modified Julian Date timestamp
*/
static String getMjd(String delimiter) {
Calendar cal = Calendar.getInstance(); // get current date and time
Expand Down

0 comments on commit 56c98d8

Please sign in to comment.