Skip to main content

DDS Document Generator

Project description

OmniCon DDS Document Generator - API

Project description

OmniCon Document Generator (DocGen) generates an ICD/documentation from standard DDS type files. The DocGen is utilized via a simple Python API or via a dedicated GUI (see Omnicon DDS DocGen GUI)

Installation

API Usage Example

The following example generates an PDF & Docx ICD from a provided DDS "ShapeType.xml" and a topics mapping, "TopicNamesToTypesDefMap.xml".

from Omnicon_DDSDocGen.Omnicon_DDSDocGen import DDSDocGen

doc_gen = DDSDocGen()
doc_gen.generate_document(
    dds_types_files=["ShapeType.xml"],
    dds_topics_types_mapping="TopicNamesToTypesDefMap.xml",
    version="v1.0",
    title="Demo ICD",
    order_alphabetically=True,
    output_file_name="DemoICD",
    output_folder="",
    output_formats=['pdf', 'docx'])

ShapeType.xml (based on http://www.omg.org/spec/DDS-XML)

<?xml version="1.0" encoding="UTF-8"?>
<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <enum name="ShapeFillKind">
    <enumerator name="SOLID_FILL"/>
    <enumerator name="TRANSPARENT_FILL"/>
    <enumerator name="HORIZONTAL_HATCH_FILL"/>
    <enumerator name="VERTICAL_HATCH_FILL"/>
  </enum>
  <struct name= "ShapeType">
    <member name="color" stringMaxLength="128" type="string" key="true"/>
    <member name="x" type="int32"/>
    <member name="y" type="int32"/>
    <member name="shapesize" type="int32"/>
  </struct>
  <struct name= "ShapeTypeExtended" baseType="ShapeType">
    <member name="fillKind" type="nonBasic"  nonBasicTypeName= "ShapeFillKind"/>
    <member name="angle" type="float32"/>
  </struct>
</types>

TopicNamesToTypesDefMap.xml (based on http://www.omg.org/spec/DDS-XML)

<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <domain_library name="Domain_Lib">
    <domain name="Domain">
      <!--Types Definition-->
      <register_type name="ShapeTypeExtended" type_ref="ShapeTypeExtended" />

      <!--Topics Definition-->
      <topic name="Square" register_type_ref="ShapeTypeExtended"/>
    </domain>
  </domain_library>
</dds>

API Arguments

Argument Type Description Optional Default value
dds_types_files list[str] A list of file or folders names, in an order specified by the user according to files dependencies.
dds_topics_types_mapping string An XML file that contains a DDS topic to type mapping. Sending an empty string ("") will switch ICD from topic-based to type-based document * (creates type based document)
output_file_name string The user's file name of choice * "ICD"
title string The title/heading of the document. This string will be added to the first page of the document. * "ICD"
version string The document's version number - This string will be added to the top page of the ICD. * "1.0"
order_alphabetically bool Select the order of generated document topics/types: alphabetically or according to the loaded files order * True (alphabetically)
output_folder string The user's output folder of choice * current working directory
output_formats list[str] A list of desired output formats as strings (list must contain at least one option)
update_progress_bar_function function A 'pointer' to the function that updates the progress bar. * None

API Return values

The API returns a tuple: (bool, list[str]).

  • The boolean indicates whether a document was created (True) or not (False).
  • The list of strings holds information regarding the creation of the file(s), such as errors detected in a certain topic/type.

The message format is as follows:

[severity level] [time] - [file format] - [message]
  • Severity level: could be one of the following: 'Critical', 'Error', 'Warning', 'Info' or 'Debug'.
  • Time: a time stamp, in the following format: yyyy-mm-dd hh:mm:ss.
  • File format: Either a PDF or DOCX.
  • Message: The information regarding the creation of the specified file

Example:

[ERROR] 2023-03-02 09:17:51.428162 - PDF - Failed to parse topic myTopic . Error : Could not find 'MyType' in provided files!
[INFO] 2023-03-02 09:17:57.693217 - PDF - File saved successfully into 'D:\my\folder\TestingICD.pdf'
[ERROR] 2023-03-02 09:17:57.862493 - DOCX - Failed to parse topic myTopic . Error : Could not find 'MyType' in provided files!
[INFO] 2023-03-02 09:18:01.674094 - DOCX - File saved successfully into 'D:\my\folder\TestingICD.docx'    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

Omnicon_DDSDocGen-2.1.0-1-cp37-cp37m-win_amd64.whl (57.5 kB view details)

Uploaded CPython 3.7mWindows x86-64

Omnicon_DDSDocGen-2.1.0-0-cp37-cp37m-win_amd64.whl (56.6 kB view details)

Uploaded CPython 3.7mWindows x86-64

File details

Details for the file Omnicon_DDSDocGen-2.1.0-1-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for Omnicon_DDSDocGen-2.1.0-1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 c36cea1d99772a0b1380ce640e8c02132ac6b305e88ee6601d919a5858d5506e
MD5 f12807b768d2a730dcb31c04ea424f06
BLAKE2b-256 85d4e4a357d0c22712628bdf7ae167bdc872e3832bc423937d35d8e455f77a0c

See more details on using hashes here.

File details

Details for the file Omnicon_DDSDocGen-2.1.0-0-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for Omnicon_DDSDocGen-2.1.0-0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 45c98f99170486ba121802215862a091c8586385d31bde3daa7f72d689882a77
MD5 a42ca2a35ab72fccb014c380e0d80887
BLAKE2b-256 acddb4b5688ad8070321ac6c8c97711b1ff77244b3c72376eb0d07a48c1094a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page