-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add new class to create pdf reports. * Added unit tests * Added example * Added example * Revert "Added example" This reverts commit 70851ac. * Added example * Net6_refactoring * Back to .net framework * Back to .net framework * Back to .net framework * Back to .net framework * Back to .net framework * Back to .net framework * Back to .net framework * Back to .net framework * Back to .net framework * Back to .net framework * Back to .net framework * Back to .net framework * Back to .net framework * Back to .net framework * Updated to .netcore * Updated to .netcore * Updated to .netcore * Updated to .netcore * Updated to .netcore * Updated to .netcore * Updated to .netcore * Updated to .netcore * Updated to .netcore * Updated to .netcore --------- Co-authored-by: maxcapodi78 <Shark78> Co-authored-by: svandenb <[email protected]>
- Loading branch information
1 parent
ea05a16
commit c57b881
Showing
41 changed files
with
93,073 additions
and
41,499 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import os | ||
|
||
from _unittest.conftest import desktop_version | ||
from _unittest.conftest import local_path | ||
from _unittest.conftest import scratch_path | ||
|
||
from pyaedt import pyaedt_path | ||
from pyaedt.generic.pdf import AnsysReport | ||
|
||
try: | ||
import pytest # noqa: F401 | ||
except ImportError: | ||
import _unittest_ironpython.conf_unittest as pytest # noqa: F401 | ||
|
||
tol = 1e-12 | ||
|
||
|
||
class TestClass(object): | ||
def setup_class(self): | ||
pass | ||
|
||
def teardown_class(self): | ||
pass | ||
|
||
def test_create_pdf(self): | ||
template_path = os.path.join(pyaedt_path, "dlls", "PDFReport", "AnsysTemplate.json") | ||
report = AnsysReport(project_name="Coaxial", design_name="Design1", tempplate_json_file=template_path) | ||
report.aedt_version = desktop_version | ||
assert "AnsysTemplate" in report.template_name | ||
report.template_name = "AnsysTemplate" | ||
assert report.project_name == "Coaxial" | ||
report.project_name = "Coaxial1" | ||
assert report.project_name == "Coaxial1" | ||
assert report.design_name == "Design1" | ||
report.design_name = "Design2" | ||
assert report.design_name == "Design2" | ||
report.create() | ||
report.add_section() | ||
report.add_chapter("Chapter 1") | ||
report.add_sub_chapter("C1") | ||
report.add_text("ciao") | ||
report.add_text("ciao2", True, True) | ||
report.add_empty_line(2) | ||
report.add_page_break() | ||
report.add_image(os.path.join(local_path, "example_models", "Coax_HFSS.jpg"), "Coaxial Cable") | ||
report.add_section("L") | ||
report.add_table("MyTable", [["x", "y"], ["0", "1"], ["2", "3"], ["10", "20"]]) | ||
report.add_section() | ||
report.add_chart([0, 1, 2, 3, 4, 5], [10, 20, 4, 30, 40, 12], "Freq", "Val", "MyTable") | ||
report.add_toc() | ||
assert os.path.exists(report.save_pdf(scratch_path, "my_firstpdf.pdf")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.