Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e713b54
Update page margin
LMaster765 Mar 4, 2025
aedcb30
Add compile commands (clang LSP) to gitignore
brennenputh Mar 4, 2025
4fc59cc
Merge branch 'html-report' of github.com:brennenputh/centrallix into …
brennenputh Mar 4, 2025
ea4fcff
Added clang cache to gitignore
brennenputh Mar 4, 2025
b27d224
fix previous commit
brennenputh Mar 4, 2025
59d3bf6
Remove legacy statement from DOCTYPE header
brennenputh Mar 4, 2025
8392d0c
Changed the images to work from base64 encoded strings
theTrueEnder Mar 4, 2025
1eed0ff
Merge branch 'html-report' of github.com:brennenputh/centrallix into …
theTrueEnder Mar 4, 2025
b75c79c
Update area and string generation
LMaster765 Mar 4, 2025
44e451a
Merge branch 'html-report' of github.com:brennenputh/centrallix into …
LMaster765 Mar 4, 2025
bfe7c0b
I don't know if this works, but it is based on the other image code t…
theTrueEnder Mar 4, 2025
9bda1c0
Merge branch 'html-report' of github.com:brennenputh/centrallix into …
theTrueEnder Mar 4, 2025
53b6a8a
Make the top level a div instead of a table
brennenputh Mar 5, 2025
5e3ce45
Improve string generation
LMaster765 Mar 5, 2025
a840bb6
Merge branch 'html-report' of github.com:brennenputh/centrallix into …
LMaster765 Mar 5, 2025
06d3ebc
Fix BOLD
LMaster765 Mar 5, 2025
fafbbbc
Clean up root div formatting logic
brennenputh Mar 6, 2025
871b9bc
Add getfont method to html formatting
LMaster765 Mar 6, 2025
b5fb520
Improve Area object structure for html
LMaster765 Mar 6, 2025
30582d0
Clean up formatting and move variables to be locally declared
brennenputh Mar 6, 2025
0492f74
Merge branch 'html-report' of github.com:brennenputh/centrallix into …
brennenputh Mar 6, 2025
02ef6c2
Update strings
LMaster765 Mar 6, 2025
34ce9bf
Add table borders
LMaster765 Mar 6, 2025
e9924a8
Improve table borders
LMaster765 Mar 7, 2025
a2fcf49
Finish cleaning up and commenting new code
brennenputh Mar 7, 2025
ba76586
Merge branch 'html-report' of github.com:brennenputh/centrallix into …
brennenputh Mar 7, 2025
2847859
Make the absolute text have a relative div which specifies its height
brennenputh Mar 7, 2025
851d46b
Pusing for Brennen. Fixed some formatting
LMaster765 Mar 7, 2025
2109770
Continue to improve (?) formatting
LMaster765 Mar 7, 2025
e8ee839
Improve code commenting and formatting
LMaster765 Mar 7, 2025
c4e60ab
Add sysdoc document for HTML report project
brennenputh Mar 7, 2025
2f13409
Start flag documentation
LMaster765 Mar 7, 2025
5b5489e
Merge
brennenputh Mar 7, 2025
2f6aa14
Add more documentation
LMaster765 Mar 7, 2025
3a32b90
Add next steps to post-sprint documentation
LMaster765 Mar 7, 2025
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ perf.data.old
.idea/
.vscode/
centrallix-os/tmp/*
compile_commands.json
.cache/
123 changes: 123 additions & 0 deletions centrallix-sysdoc/HTMLReportOutput.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
## Tooling

To generate a report, open up the Kardia/Centrallix instance running on your firewall. The ports will be shown on the Kardia interface.
There is no specific path to generating a report,

### Generating Compile Commands

Install compiledb with `sudo python3 -m pip install compiledb`.
Generate the compile_commands.json with the following commands (starting at root).

```sh
cd centrallix
compiledb make all
```

The reason for creating this is to use a tool such as [clangd](https://clangd.llvm.org/).
There is a VSCode extension which supports using it, even on servers which do not support clangd.
`clangd` will allow for LSP usage within the project, adding helpful multi-file errors and jump to definition.
Perhaps it may be wise to at some point go over the entire project and resolve its warnings and errors as possible.

## Process

### Generating a Report

To generate a report, open up the Kardia/Centrallix instance running on your firewall. The ports will be shown on the Kardia interface.
There is no specific path to generating a report, it depends on which sort of report you would like to generate.
Ask Greg which reports he would like you to work on.

### Sending an HTML Email

This requires the use of a Mutt client on a Linux machine for simplicity.
The configuration used ([source](https://mritunjaysharma394.medium.com/how-to-set-up-mutt-text-based-mail-client-with-gmail-993ae40b0003)) is specific to GMail clients.
The template configuration for Mutt using a GMail account can be found below.
You will need to generate an app password with the instructions [here](https://support.google.com/accounts/answer/185833?hl=en), and use that as your password.

```
# ================ IMAP ====================
set imap_user = <youremail>@gmail.com
set imap_pass = <pass>
set spoolfile = imaps://imap.gmail.com/INBOX
set folder = imaps://imap.gmail.com/
set record="imaps://imap.gmail.com/[Gmail]/Sent Mail"
set postponed="imaps://imap.gmail.com/[Gmail]/Drafts"
set mbox="imaps://imap.gmail.com/[Gmail]/All Mail"
set header_cache = "~/.mutt/cache/headers"
set message_cachedir = "~/.mutt/cache/bodies"
set certificate_file = "~/.mutt/certificates"
# ================ SMTP ====================
set smtp_url = "smtp://<youremail>@smtp.gmail.com:587/"
set smtp_pass = $imap_pass
set ssl_force_tls = yes # Require encrypted connection
# ================ Composition ====================
set editor = "nvim" # Set your favourite editor.
set edit_headers = yes # See the headers when editing
set charset = UTF-8 # value of $LANG; also fallback for send_charset
# Sender, email address, and sign-off line must match
unset use_domain
set realname = "<name>"
set from = "<youremail>@gmail.com"
set use_from = yes
```

Once Mutt has been set up, use the following command to send the HTML email from your GMail account.
It is indeed totally valid to use your own email address as the target email.
```
mutt -e "set content_type=text/html" <TARGET_EMAIL> -s "<EMAIL_SUBJECT>" < <PATH_TO_FILE>
```

## PrtObjStream and pPrtObjStream

The `PrtObjStream` struct and pointer (`pPrtObjStream`) store all of the information about the data being printed. The struct definition can be found in [prtmgmt_v3.h](../centrallix/include/prtmgmt_v3/prtmgmt_v3.h). There is also a type-specific struct that stores additional data for each data type. These are found in the same folder as prtmgmt_v3.h as "prtmgmt_v3_lm_(type).h" for the text, table, and col types.

### Special Flags

There are a variety of useful flags in the `PrtObjStream` struct scattered throughout the project. We have documented most of the ones we have found below. Most of the flags are defined in the same file as the `PrtObjStream` flag.

#### PRT_OBJ_F_NEWLINE

- **Location**: [prtmgmt_v3.h](../centrallix/include/prtmgmt_v3/prtmgmt_v3.h)

- **Description**: Indicates that the object begins with a newline (typically for string flow).

#### PRT_OBJ_F_SOFTNEWLINE

- **Location**: [prtmgmt_v3.h](../centrallix/include/prtmgmt_v3/prtmgmt_v3.h)

- **Description**: Indicates that the object begins with a soft newline (typically for string flow). Soft newlines are inserted when the PrtObjStream is created to define breakpoints for the PDF generator; they are not defined in the .rpt files.

#### PRT_OBJ_F_XSET

- **Location**: [prtmgmt_v3.h](../centrallix/include/prtmgmt_v3/prtmgmt_v3.h)

- **Description**: Indicates that the object has an abosulute x-position defined by the .rpt file.

#### PRT_OBJ_F_YSET

- **Location**: [prtmgmt_v3.h](../centrallix/include/prtmgmt_v3/prtmgmt_v3.h)

- **Description**: Indicates that the object has an abosulute y-position defined by the .rpt file.

#### PRT_TEXTLM_F_RMSPACE

- **Location**: [prtmgmt_v3_lm_text.h](../centrallix/include/prtmgmt_v3/prtmgmt_v3_lm_text.h)

- **Description**: Indicates that the string object replaced a space character with a soft newline. Useful for deciding whether or not to insert a space character when a soft newline is found.

## Next Steps

### Sending in email

We found that some of the design goals (encoding the images in the file with base 64 and using flexbox designs instead of a tabular system) may not be compatible with sending the HTML via email. Further research into the issue is needed along with some potential redesigning of the HTML generator.

### Table spacing

We hard-coded padding values inside of table cells to match the receipt report file that we were given. However, this value was not quite right for the donation detail report. We could not find a cell padding value in the `PrtObjStream` struct, but there may be something we missed. Some of the vertical sizing of the tables is also not consistent with the PDF output, but we did not see any cell height info the struct.

### Absolute positioning

Not all absolute position rules are honored. For example, the "pls_retain" and "rcpt_summary" areas defined in the receipt report have no spacing between them, but there should be one y unit between them.

### Image positioning issues

The receipt report has a Centrallix icon in the lower right corner that was moved to the middle of the page. We did not have an opportunity to look into this issue.
Loading