Skip to content
Snippets Groups Projects
Commit 70b12cf6 authored by Rolf Niepraschk's avatar Rolf Niepraschk
Browse files

Vereinfacht, templates neu begonnen

parent d1389073
Branches
Tags
No related merge requests found
Showing
with 69 additions and 857 deletions
......@@ -8,3 +8,9 @@ cat dcc-2019-75058.xml | xmllint --format - > foo.xml
cat dcc-2019-75059.xml | tidy -xml --indent auto --indent-cdata yes --quiet yes \
--wrap 0 --tab-size 2 - > examples/vakuumlabor.xml
--------------------------------------------------------
warum Array?
"contact": [
---
......@@ -2,20 +2,10 @@
"git":{
"dir": "."
},
"db":{
"host": "a73434.berlin.ptb.de",
"port": 5984,
"database": "vl_db"
},
"server": {
"host":"0.0.0.0",
"port":5006
},
"views":{
"cal_docs":"share/Cert"
},
"templates":{
"xml":"xml",
"latex":"latex"
}
"cert_doc_url":"http://a73434:5001/dcc/",
"main_xml_template_file":"xml/dcc.xml"
}
......@@ -4,8 +4,7 @@ import re
from flask import Flask, request, jsonify, send_from_directory, make_response
from flask_cors import CORS
from vl_dcc.db import DB
from vl_dcc.trans import Trans
import vl_dcc.trans as trans
import vl_dcc.utils as utils
from pprint import pprint
......@@ -13,26 +12,28 @@ from pprint import pprint
config = utils.config
app = Flask(__name__, static_url_path='')
app.url_map.strict_slashes = False
CORS(app)
db = DB(config, app)
trans = Trans(config, app, db)
@app.route('/vl-dcc/<cer_doc_id>', methods=['GET'])
def to_xml(cer_doc_id):
if cer_doc_id:
cert_doc = db.get_doc(cer_doc_id)
# http://a73434:5001/dcc/2020_75012
@app.route('/vl-dcc/<year_cert>', methods=['GET'])
def to_xml(year_cert):
cert_doc = utils.get_dcc_cert_doc(year_cert)
if not 'error' in cert_doc:
###pprint(cert_doc)
res = make_response(trans.cert_to_xml(cert_doc))
res = utils.set_filename_header(res=res, no=cer_doc_id.split("-")[-1])
res = utils.set_filename_header(res=res, no=year_cert.split("_")[1])
return res
else:
return utils.res_json(cert_doc)
else:
return utils.return_error("no document id given")# pointless!
@app.route('/vl-dcc/<year_cert>', methods=['POST'])# ???
def append_cert(year_cert):
return jsonify({'ok':True})
@app.route('/vl-dcc', methods=['GET', 'POST'])
def main():
return jsonify({'error':'Cert ID missing'})
@app.route('/update', methods=['post'])
def update():
......@@ -42,7 +43,6 @@ def update():
app.logger.info("pulled {log}".format(log=utils.git_cmd.log("-n 1")))
return jsonify({'ok':True})
@app.route('/version', methods=['get'])
def version():
app.logger.debug('hit version')
......
{% autoescape false %}<dcc:items>
<dcc:name>
<dcc:content lang="{{doc.Meta.lang}}">
{{doc.Titlepage.ObjectOfCalibration}}
</dcc:content>
</dcc:name>
<dcc:item>
<dcc:name>
<dcc:content lang="{{doc.Meta.lang}}">
{{doc.Titlepage.Type}}
</dcc:content>
</dcc:name>
<dcc:description>
<dcc:content lang="de">Prüfling</dcc:content>
<dcc:content lang="en">device under test</dcc:content>
</dcc:description>
<dcc:manufacturer>
<dcc:name>
<dcc:content lang="{{doc.Meta.lang}}">
{{doc.Titlepage.Producer}}
</dcc:content>
</dcc:name>
</dcc:manufacturer>
<dcc:identifications>
<dcc:identification>
<dcc:issuer>manufacturer</dcc:issuer>
<dcc:value>{{doc.Titlepage.Serial}}</dcc:value>
<dcc:description>
<dcc:content lang="de">Kennnummer</dcc:content>
<dcc:content lang="en">Serial No.</dcc:content>
</dcc:description>
</dcc:identification>
<dcc:identification id="geschaeftszeichen">
<dcc:issuer>calibrationLaboratory</dcc:issuer>
<dcc:value>{{doc.Titlepage.ReferenceNo}}</dcc:value>
<dcc:description>
<dcc:content lang="de">Geschäftszeichen</dcc:content>
<dcc:content lang="en">Reference No.</dcc:content>
</dcc:description>
</dcc:identification>
</dcc:identifications>
</dcc:item>
</dcc:items>{% endautoescape %}
{% autoescape false %}<dcc:calibrationLaboratory>
<dcc:contact>
<dcc:name>
<dcc:content lang="de">Physikalisch-Technische Bundesanstalt (PTB)</dcc:content>
</dcc:name>
<dcc:eMail>vacuum.cal@ptb.de</dcc:eMail>
<dcc:location>
<dcc:further>
<dcc:content lang="de">Arbeitsgruppe 7.54 Vakuummetrologie</dcc:content>
<dcc:content lang="en">Working Group 7.54 Vacuum Metrology</dcc:content>
</dcc:further>
<dcc:street>Abbestraße</dcc:street>
<dcc:streetNo>2–12</dcc:streetNo>
<dcc:postCode>10178</dcc:postCode>
<dcc:city>Berlin</dcc:city>
<dcc:countryCode>DE</dcc:countryCode>
</dcc:location>
</dcc:contact>
</dcc:calibrationLaboratory>{% endautoescape %}
{% autoescape false %}<dcc:calibrationLocations>
<dcc:calibrationLocation>
<dcc:name lang="de">Physikalisch-Technische Bundesanstalt (PTB)</dcc:name>
<dcc:name lang="en">Physikalisch-Technische Bundesanstalt (PTB)</dcc:name>
<dcc:eMail>karl.jousten@ptb.de</dcc:eMail>
<dcc:location lang="de">
<dcc:further>Abteilung 7 Temperatur und Synchrotronstrahlung</dcc:further>
<dcc:further>Fachbereich 7.5 Wärme und Vakuum</dcc:further>
<dcc:further>Arbeitsgruppe 7.54 Vakuummetrologie</dcc:further>
<dcc:further>Raum 024 im Försterbau</dcc:further>
<dcc:street>Abbestraße</dcc:street>
<dcc:streetNo>2-12</dcc:streetNo>
<dcc:postCode>10587</dcc:postCode>
<dcc:city>Berlin</dcc:city>
<dcc:countryC>de</dcc:countryC>
</dcc:location>
<dcc:location lang="en">
<dcc:further>Division 7 Mechanics and Acoustics</dcc:further>
<dcc:further>Department 7.5 Heat and Vacuum</dcc:further>
<dcc:further>Working Group 7.54 Vacuum Metrology</dcc:further>
<dcc:further>Room 024 in the Försterbau</dcc:further>
<dcc:street>Abbestraße</dcc:street>
<dcc:streetNo>2-12</dcc:streetNo>
<dcc:postCode>10178</dcc:postCode>
<dcc:city>Berlin</dcc:city>
<dcc:countryC>de</dcc:countryC>
</dcc:location>
</dcc:calibrationLocation>
</dcc:calibrationLocations>{% endautoescape %}
{% autoescape false %}<dcc:coreData>
<dcc:countryCodeISO3166_1>DE</dcc:countryCodeISO3166_1>
<dcc:usedLangCodeISO639_1>de</dcc:usedLangCodeISO639_1>
<dcc:usedLangCodeISO639_1>en</dcc:usedLangCodeISO639_1>
<dcc:mandatoryLangCodeISO639_1>de</dcc:mandatoryLangCodeISO639_1>
<dcc:uniqueIdentifier>{{doc.Titlepage.Certificate}}PTB{{doc.Titlepage.ShortYear}}</dcc:uniqueIdentifier>
<dcc:receiptDate>{{doc.Titlepage.CertificateDate}}</dcc:receiptDate>
<dcc:beginPerformanceDate>{{doc.Titlepage.MeasurementDateBegin}}</dcc:beginPerformanceDate>
<dcc:endPerformanceDate>{{doc.Titlepage.MeasurementDateEnd}}</dcc:endPerformanceDate>
<dcc:countryCodeISO3166_1>
{{doc.administrativeData.coreData.countryCodeISO3166_1}}
</dcc:countryCodeISO3166_1>
<dcc:usedLangCodeISO639_1>
{{doc.administrativeData.coreData.usedLangCodeISO639_1}}
</dcc:usedLangCodeISO639_1>
<dcc:mandatoryLangCodeISO639_1>
{{doc.administrativeData.coreData.mandatoryLangCodeISO639_1}}
</dcc:mandatoryLangCodeISO639_1>
<dcc:uniqueIdentifier></dcc:uniqueIdentifier>
<dcc:receiptDate></dcc:receiptDate>
<dcc:beginPerformanceDate></dcc:beginPerformanceDate>
<dcc:endPerformanceDate></dcc:endPerformanceDate>
</dcc:coreData>{% endautoescape %}
{% autoescape false %}<dcc:customer>
<dcc:name>
<dcc:content lang="{{doc.Meta.lang}}">{{doc.Titlepage.Customer.Name}}</dcc:content>
</dcc:name>
<dcc:eMail>{{doc.Titlepage.Customer.Email}}</dcc:eMail>
<dcc:location>
<dcc:street>{{doc.Titlepage.Customer.Street}}</dcc:street>
<dcc:postCode>{{doc.Titlepage.Customer.Zipcode}}</dcc:postCode>
<dcc:city>{{doc.Titlepage.Customer.Town}}</dcc:city>
<dcc:countryCode>{{doc.Titlepage.Customer.CountryCode}}</dcc:countryCode>
</dcc:location>
</dcc:customer>{% endautoescape %}
......@@ -31,17 +31,9 @@
<dcc:administrativeData>
{% include 'xml/core_data.xml' %}
{% include 'xml/calibration_item.xml' %}
{% include 'xml/calibration_laboratory.xml' %}
{% include 'xml/responsible_persons.xml' %}
{% include 'xml/customer.xml' %}
{% include 'xml/used_software.xml' %}
</dcc:administrativeData>
<dcc:measurementResults>
<dcc:measurementResult>
{% include 'xml/used_methods.xml' %}
{% include 'xml/influence_conditions.xml' %}
{% include 'xml/results.xml' %}
</dcc:measurementResult>
</dcc:measurementResults>
</dcc:digitalCalibrationCertificate>
......
<?xml version="1.0" encoding="UTF-8"?>
<dcc:digitalCalibrationCertificate
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://intranet.ptb.de/fileadmin/dokumente/intranet/abteilungen/abteilung_1/Digitaler_Kalibrierschein/DCC DCC_v1.8.1.xsd"
xmlns:dcc="https://intranet.ptb.de/fileadmin/dokumente/intranet/abteilungen/abteilung_1/Digitaler_Kalibrierschein/DCC"
xmlns:si="https://intranet.ptb.de/fileadmin/dokumente/intranet/abteilungen/abteilung_1/Digitaler_Kalibrierschein/SI">
<dcc:administrativeData><!--00100-->
<dcc:usedSoftware><!--00110-->
<dcc:software id="soft1"><!--1100M-->
<dcc:name>Altova XMLSpy</dcc:name><!--11010-->
<dcc:release>2018 SP 1 (x64) Enterprise Edition</dcc:release><!--11020-->
<dcc:langCodeISO639_1>de</dcc:langCodeISO639_1><!--12040-->
<dcc:source>Altova GmbH, Rudolfsplatz 13a/9, A-1010 Wien, Österreich
https://www.altova.com/de/</dcc:source><!--11050-->
</dcc:software>
<dcc:software id="soft2"><!--1100M-->
<dcc:name>Notepad++ (32-bit)</dcc:name><!--11010-->
<dcc:release>v7.5.8</dcc:release><!--11020-->
<dcc:addOns><!--11030-->
<dcc:addOn>Compare</dcc:addOn><!--11031-->
<dcc:addOn>DSpellCheck</dcc:addOn><!--11031-->
<dcc:addOn>NppHash</dcc:addOn><!--11031-->
<dcc:addOn>XML Tools</dcc:addOn><!--11031-->
<dcc:addOn>MIME Tools</dcc:addOn><!--11031-->
<dcc:addOn>Converter</dcc:addOn><!--11031-->
<dcc:addOn>NppExport</dcc:addOn><!--11031-->
</dcc:addOns>
<dcc:langCodeISO639_1>de</dcc:langCodeISO639_1><!--12040-->
<dcc:source>https://notepad-plus-plus.org/</dcc:source><!--11050-->
<dcc:parameters><!--11060-->
<dcc:parameter>XML Tools plugin version 2.3.2 unicode beta4 r908</dcc:parameter><!--11061-->
</dcc:parameters>
</dcc:software>
</dcc:usedSoftware>
<dcc:coreData><!--00120-->
<dcc:countryCodeISO3166_1>DE</dcc:countryCodeISO3166_1><!--12010-->
<dcc:deltaUnivTimeCoord>01:00:00</dcc:deltaUnivTimeCoord><!--12020-->
<dcc:langCodeISO639_1>de</dcc:langCodeISO639_1><!--12030-->
<dcc:langCodeISO639_1>en</dcc:langCodeISO639_1><!--12030-->
<dcc:mandatoryLangISO639_1>de</dcc:mandatoryLangISO639_1><!--12040-->
<dcc:calibrationMark>PTB - 11044 17</dcc:calibrationMark><!--12050-->
<dcc:receiptDate>2017-09-01</dcc:receiptDate><!--12060-->
<dcc:beginPerformanceDate>2017-09-02</dcc:beginPerformanceDate><!--12080-->
<dcc:endPerformanceDate>2017-09-18</dcc:endPerformanceDate><!--12090-->
</dcc:coreData>
<dcc:items><!--00130-->
<dcc:item><!--1300M-->
<dcc:name>1 Gewichtstück zu 10 g</dcc:name><!--13010-->
<dcc:description id="Description01"><!--13020-->
<dcc:content lang="de">1 Gewichtstück zu 10 g</dcc:content><!--92110-->
<dcc:content lang="de">Aufbewahrung</dcc:content><!--92110-->
<dcc:content lang="en">Case</dcc:content><!--92110-->
<dcc:content lang="de">Die Gewichtstücke befinden sich in einem Kasten aus lackiertem Holz; das Kalibrierzeichen ist auf dem Kasten aufgebracht.</dcc:content><!--92110-->
<dcc:content lang="en">The weights are accommodated in a box of varnished wood; the calibration mark is applied to the box.</dcc:content><!--92110-->
</dcc:description>
<dcc:manufacturer><!--13050-->
<dcc:name>Häfner Gewichte GmbH</dcc:name><!--91310-->
<dcc:eMail>info@haefner.de</dcc:eMail><!--91320-->
<dcc:location><!--91330-->
<dcc:street>Hohenhardtsweiler Straße</dcc:street><!--91120-->
<dcc:streetNo>4</dcc:streetNo><!--91130-->
<dcc:postCode>74420</dcc:postCode><!--91150-->
<dcc:city>Oberrot</dcc:city><!--91160-->
<dcc:countryCode>DE</dcc:countryCode><!--91180-->
</dcc:location>
</dcc:manufacturer>
<dcc:identNumber><!--13060-->
<dcc:manufacturer>Kennnummer: 1040917</dcc:manufacturer><!--12061-->
<dcc:manufacturer>Serial No.: 1040917</dcc:manufacturer><!--12061-->
<dcc:calibrationLaboratory>Kennzeichnung: 18L</dcc:calibrationLaboratory><!--12070-->
<dcc:calibrationLaboratory>Marking: 18L</dcc:calibrationLaboratory><!--12070-->
</dcc:identNumber>
</dcc:item>
</dcc:items>
<dcc:calibrationLaboratory><!--00140-->
<dcc:contact><!--91300-->
<dcc:name>Physikalisch-Technische Bundesanstalt (PTB)</dcc:name><!--91310-->
<dcc:eMail>info@ptb.de</dcc:eMail><!--91320-->
<dcc:location><!--91330-->
<dcc:further lang="de">Abteilung 1 Mechanik und Akustik</dcc:further><!--91110-->
<dcc:further lang="en">Division 1 Mechanics and Acoustics</dcc:further><!--91110-->
<dcc:further lang="de">Fachbereich 1.8 Masse – Darstellung der Einheit</dcc:further><!--91110-->
<dcc:further lang="en">Department 1.8 Mass - Realization of the Unit</dcc:further><!--91110-->
<dcc:further lang="de">Arbeitsgruppe 1.81 Darstellung Masse</dcc:further><!--91110-->
<dcc:further lang="en">Working Group 1.81 Realization of Mass</dcc:further><!--91110-->
<dcc:further lang="de">Dr. Michael Borys o. V. i. A.</dcc:further><!--91110-->
<dcc:further lang="en">Dr. Michael Borys or representative in office</dcc:further><!--91110-->
<dcc:street>Bundesallee</dcc:street><!--91120-->
<dcc:streetNo>100</dcc:streetNo><!--91130-->
<dcc:postCode>38116</dcc:postCode><!--91150-->
<dcc:city lang="de">Braunschweig</dcc:city><!--91160-->
<dcc:city lang="en">Brunswick</dcc:city><!--91160-->
<dcc:countryCode>DE</dcc:countryCode><!--91180-->
</dcc:location>
</dcc:contact>
</dcc:calibrationLaboratory>
<dcc:calibrationLocations><!--00150-->
<dcc:calibrationLocation><!--1500M-->
<dcc:calibrationLocationSites>Physikalisch-Technische Bundesanstalt (PTB)</dcc:calibrationLocationSites><!--15010-->
<dcc:location><!--91330-->
<dcc:further lang="de">Abteilung 1 Mechanik und Akustik</dcc:further><!--91110-->
<dcc:further lang="en">Division 1 Mechanics and Acoustics</dcc:further><!--91110-->
<dcc:further lang="de">Fachbereich 1.8 Masse – Darstellung der Einheit</dcc:further><!--91110-->
<dcc:further lang="en">Department 1.8 Mass - Realization of the Unit</dcc:further><!--91110-->
<dcc:further lang="de">Arbeitsgruppe 1.81 Darstellung Masse</dcc:further><!--91110-->
<dcc:further lang="en">Working Group 1.81 Realization of Mass</dcc:further><!--91110-->
<dcc:further lang="de">Raum 1.23 im Besselbau</dcc:further><!--91110-->
<dcc:further lang="en">Room 1.23 in the Besselbau</dcc:further><!--91110-->
<dcc:street>Bundesallee</dcc:street><!--91120-->
<dcc:streetNo>100</dcc:streetNo><!--91130-->
<dcc:postCode>38116</dcc:postCode><!--91150-->
<dcc:city lang="de">Braunschweig</dcc:city><!--91160-->
<dcc:city lang="en">Brunswick</dcc:city><!--91160-->
<dcc:countryCode>DE</dcc:countryCode><!--91180-->
</dcc:location>
</dcc:calibrationLocation>
</dcc:calibrationLocations>
<dcc:respPersons><!--00160-->
<dcc:respPerson id="Responsible"><!--1600M-->
<dcc:responsiblePerson>F. Scholz</dcc:responsiblePerson><!--16010-->
<dcc:eMailResponsiblePerson>frank.scholz@ptb.de</dcc:eMailResponsiblePerson><!--16050-->
</dcc:respPerson>
<dcc:respPerson id="Technician"><!--1600M-->
<dcc:responsiblePerson>M. Hämpke</dcc:responsiblePerson><!--16010-->
<dcc:eMailResponsiblePerson>michael.haempke@ptb.de</dcc:eMailResponsiblePerson><!--16050-->
</dcc:respPerson>
<dcc:respPerson id="Signature"><!--1600M-->
<dcc:responsiblePerson>S. Hackel</dcc:responsiblePerson><!--16010-->
<dcc:kryptElectronicSignature>true</dcc:kryptElectronicSignature><!--16030-->
<dcc:eMailResponsiblePerson>siegfried.hackel@ptb.de</dcc:eMailResponsiblePerson><!--16050-->
</dcc:respPerson>
</dcc:respPersons>
<dcc:usedMethods><!--00170-->
<dcc:usedMethod><!--1700M-->
<dcc:name lang="de">Hydrostatische Wägemethode</dcc:name><!--17010-->
<dcc:name lang="en">Hydrostatic weighing method</dcc:name><!--17010-->
<dcc:description id="Method01"><!--17020-->
<dcc:content lang="de">Verfahren</dcc:content><!--92110-->
<dcc:content lang="en">Procedure</dcc:content><!--92110-->
<!-- Demo for formatting HTML or LaTeX -->
<dcc:content lang="de"><![CDATA[<p>Die Volumenbestimmung für <latex>$m \ge 1 g$</latex> erfolgte nach der hydrostatischen Wägemethode.</p>]]></dcc:content><!--92110-->
<dcc:content lang="en"><![CDATA[<p>The volume determination for <latex>$m \ge 1 g$</latex> was carried out with the hydrostatic weighing method.</p>]]></dcc:content><!--92110-->
<dcc:content lang="de">Die Kalibrierung erfolgte durch Vergleich mit den Hauptnormalen der PTB nach der Substitutionsmethode mit Auftriebskorrektion.</dcc:content><!--92110-->
<dcc:content lang="en">The calibration was ensued through comparison with the reference standards of PTB using the substitution method with air buoyancy correction.</dcc:content><!--92110-->
</dcc:description>
</dcc:usedMethod>
</dcc:usedMethods>
<dcc:customer><!--00180-->
<dcc:name>Physikalisch-Technische Bundesanstalt (PTB)</dcc:name><!--91310-->
<dcc:eMail>info@ptb.de</dcc:eMail><!--91320-->
<dcc:location><!--91330-->
<dcc:further lang="de">Abteilung 1 Mechanik und Akustik</dcc:further><!--91110-->
<dcc:further lang="en">Division 1 Mechanics and Acoustics</dcc:further><!--91110-->
<dcc:further lang="de">Fachbereich 1.1 Masse – Weitergabe der Einheit</dcc:further><!--91110-->
<dcc:further lang="en">Department 1.1 Mass - Dissemination of the Unit</dcc:further><!--91110-->
<dcc:further lang="de">Arbeitsgruppe 1.15 Metrologie in der Wägetechnik</dcc:further><!--91110-->
<dcc:further lang="en">Working Group 1.15 Metrology in Weighing Technology</dcc:further><!--91110-->
<dcc:further lang="de">Dr. Christian Rothleitner o. V. i. A.</dcc:further><!--91110-->
<dcc:further lang="en">Dr. Christian Rothleitner or representative in office</dcc:further><!--91110-->
<dcc:street>Bundesallee</dcc:street><!--91120-->
<dcc:streetNo>100</dcc:streetNo><!--91130-->
<dcc:postCode>38116</dcc:postCode><!--91150-->
<dcc:city lang="de">Braunschweig</dcc:city><!--91160-->
<dcc:city lang="en">Brunswick</dcc:city><!--91160-->
<dcc:countryCode>DE</dcc:countryCode><!--91180-->
</dcc:location>
</dcc:customer>
<dcc:statements><!--00230-->
<dcc:statement><!--2300M-->
<dcc:norm>DIN EN ISO/IEC 17025:2018-03</dcc:norm><!--23030-->
<dcc:reference>7.8.2.1 l)</dcc:reference><!--23040-->
<dcc:value>Die Ergebnisse beziehen sich nur auf den in diesem DCC beschriebenen Gegenstand.</dcc:value><!--23040-->
</dcc:statement>
<dcc:statement><!--2300M-->
<dcc:norm>DIN EN ISO/IEC 17025:2018-03</dcc:norm><!--23030-->
<dcc:reference>7.8.2.1 l)</dcc:reference><!--23040-->
<dcc:value>The results refer only to the object calibrated in this DCC.</dcc:value><!--23040-->
</dcc:statement>
<dcc:statement><!--2300M-->
<dcc:convention>MRA</dcc:convention> <!--23020-->
<dcc:valueBool>true</dcc:valueBool><!--23060-->
</dcc:statement>
<dcc:statement><!--2300M-->
<dcc:norm>DIN EN ISO/IEC 17025:2018-03</dcc:norm><!--23030-->
<dcc:reference>7.8.4.3</dcc:reference><!--23040-->
<dcc:value>Die Ergebnisse gelten zum Zeitpunkt der Kalibrierung. Es obliegt dem Antragsteller, zu gegebener Zeit eine Rekalibrierung zu veranlassen.</dcc:value><!--23040-->
</dcc:statement>
<dcc:statement><!--2300M-->
<dcc:norm>DIN EN ISO/IEC 17025:2018-03</dcc:norm><!--23030-->
<dcc:reference>7.8.4.3</dcc:reference><!--23040-->
<dcc:value>The results refer only to the object calibrated in this DCC.The measurement results are valid at the time of calibration. The applicant is responsible for arranging a recalibration in due time.</dcc:value><!--23040-->
</dcc:statement>
</dcc:statements>
</dcc:administrativeData>
<!-- #####################################################################################
End of administrativeData part of the DCC
-->
<dcc:measurementResults><!--00300-->
<dcc:influenceConditions><!--00301-->
<dcc:influenceCondition lang="de" id="Umgebungsbedingungen"><!--3010M-->
<dcc:name lang="de">Umgebungsbedingungen</dcc:name><!--31010-->
<dcc:name lang="en">Ambient conditions</dcc:name><!--31010-->
<dcc:description><!--31020-->
<dcc:content lang="de">Die Kalibrierung wurde bei folgenden Umgebungsbedingungen ausgeführt:</dcc:content><!--92110-->
<dcc:content lang="en">The calibration was carried out under the following ambient conditions:</dcc:content><!--92110-->
</dcc:description>
<dcc:outcome><!--32000-->
<dcc:text><!--32010-->
<dcc:content lang="de">Temperatur: von / bis / Unsicherheit</dcc:content><!--92110-->
<dcc:content lang="de">temperature: from / to / uncertainty</dcc:content><!--92110-->
</dcc:text>
<dcc:data><!--32060-->
<dcc:quantity><!--33010-->
<si:list><!--34040-->
<si:realCS><!--34030-->
<si:pattern>value</si:pattern>
<si:values>294.55, 294.65</si:values>
</si:realCS>
<si:unit>\kelvin</si:unit>
<si:uncertainty>0.2</si:uncertainty>
<si:coverageFactor>2</si:coverageFactor>
<si:coverageProbability>0.95</si:coverageProbability>
</si:list>
</dcc:quantity>
</dcc:data>
<dcc:text><!--32010-->
<dcc:content lang="de">rel. Luftfeuchte: von / bis / Unsicherheit</dcc:content><!--92110-->
<dcc:content lang="de">relative humidity: from / to / uncertainty</dcc:content><!--92110-->
</dcc:text>
<dcc:data><!--32060-->
<dcc:quantity><!--33010-->
<si:list><!--34040-->
<si:realCS><!--34030-->
<si:pattern>value</si:pattern>
<si:values>0.46, 0.47</si:values>
</si:realCS>
<si:unit>\one</si:unit>
<si:uncertainty>0.05</si:uncertainty>
<si:coverageFactor>2</si:coverageFactor>
<si:coverageProbability>0.95</si:coverageProbability>
</si:list>
</dcc:quantity>
</dcc:data>
<dcc:text><!--32010-->
<dcc:content lang="de">Luftdruck: von / bis / Unsicherheit</dcc:content><!--92110-->
<dcc:content lang="de">air pressure: from / to / uncertainty</dcc:content><!--92110-->
</dcc:text>
<dcc:data><!--32060-->
<dcc:quantity><!--33010-->
<si:list><!--34040-->
<si:realCS><!--34030-->
<si:pattern>value</si:pattern>
<si:values>1.0070E5,1.0099E5</si:values>
</si:realCS>
<si:unit>\kilogram\metre\tothe{-1}\second\tothe{-2}</si:unit>
<si:uncertainty>0.2</si:uncertainty>
<si:coverageFactor>2</si:coverageFactor>
<si:coverageProbability>0.95</si:coverageProbability>
</si:list>
</dcc:quantity>
</dcc:data>
</dcc:outcome>
</dcc:influenceCondition>
</dcc:influenceConditions>
<dcc:results><!--00306-->
<dcc:result><!--3060M-->
<dcc:name lang="de">Konventioneller Wägewert und Fehlergrenze entsprechend OIML R 111</dcc:name><!--31010-->
<dcc:name lang="en">Conventional mass and maximum permissible error corresponding to OIML R 111</dcc:name><!--31010-->
<dcc:outcome><!--32000-->
<dcc:data id="OIML_R_111" comment="Conventional mass and maximum permissible error corresponding to OIML R 111"><!--32060-->
<dcc:quantity><!--33010-->
<si:real><!--34020-->
<si:value>10.000006E-3</si:value>
<si:unit>\kilogram</si:unit>
<si:uncertainty>0.000004E-3</si:uncertainty>
<si:coverageFactor>2</si:coverageFactor>
<si:coverageProbability>0.95</si:coverageProbability>
</si:real>
</dcc:quantity>
</dcc:data>
</dcc:outcome>
</dcc:result>
<dcc:result><!--3060M-->
<dcc:name lang="de">Masse</dcc:name><!--31010-->
<dcc:name lang="en">mass</dcc:name><!--31010-->
<dcc:outcome><!--32000-->
<dcc:data id="Mass" comment="Mass"><!--32060-->
<dcc:quantity><!--33010-->
<si:real><!--34020-->
<si:value>10.000003E-3</si:value>
<si:unit>\kilogram</si:unit>
<si:uncertainty>0.000004E-3</si:uncertainty>
<si:coverageFactor>2</si:coverageFactor>
<si:coverageProbability>0.95</si:coverageProbability>
</si:real>
</dcc:quantity>
</dcc:data>
</dcc:outcome>
</dcc:result>
<dcc:result><!--3060M-->
<dcc:name lang="de">Dichte</dcc:name><!--31010-->
<dcc:name lang="en">density</dcc:name><!--31010-->
<dcc:description>
<dcc:content lang="de">Dichte bei gegebener Temperatur</dcc:content><!--92110-->
<dcc:content lang="en">density at given temperature</dcc:content><!--92110-->
</dcc:description>
<dcc:outcome><!--32000-->
<dcc:data id="Density" comment="Density"><!--32060-->
<dcc:quantity><!--33010-->
<si:real><!--34020-->
<si:value>8012.8</si:value>
<si:unit>\kilogram\metre\tothe{-3}</si:unit>
<si:uncertainty>3.2</si:uncertainty>
<si:coverageFactor>2</si:coverageFactor>
<si:coverageProbability>0.95</si:coverageProbability>
</si:real>
<dcc:ambientConditions><!--34060-->
<dcc:quantity><!--33010-->
<si:real><!--34020-->
<si:value>293.15</si:value>
<si:unit>\kelvin</si:unit>
</si:real>
</dcc:quantity>
</dcc:ambientConditions>
</dcc:quantity>
</dcc:data>
</dcc:outcome>
</dcc:result>
<dcc:result><!--3060M-->
<dcc:name lang="de">Volumen</dcc:name><!--31010-->
<dcc:name lang="en">Volume</dcc:name><!--31010-->
<dcc:description>
<dcc:content lang="de">Volumen bei gegebener Temperatur</dcc:content><!--92110-->
<dcc:content lang="en">volume at given temperature</dcc:content><!--92110-->
</dcc:description>
<dcc:outcome><!--32000-->
<dcc:data id="Volume" comment="Volume"><!--32060-->
<dcc:quantity><!--33010-->
<si:real><!--34020-->
<si:value>1.2480E-6</si:value>
<si:unit>\metre\tothe{3}</si:unit>
<si:uncertainty>0.0005E-6</si:uncertainty>
<si:coverageFactor>2</si:coverageFactor>
<si:coverageProbability>0.95</si:coverageProbability>
</si:real>
<dcc:ambientConditions><!--34060-->
<dcc:quantity><!--33010-->
<si:real><!--34020-->
<si:value>293.15</si:value>
<si:unit>\kelvin</si:unit>
</si:real>
</dcc:quantity>
</dcc:ambientConditions>
</dcc:quantity>
</dcc:data>
</dcc:outcome>
</dcc:result>
</dcc:results>
</dcc:measurementResults>
</dcc:digitalCalibrationCertificate>
{% autoescape false %}<dcc:influenceConditions>
{%- for gas, data in doc.MeasurementData.items() %}
<dcc:influenceCondition>
<dcc:name>
<dcc:content lang="de">
Umgebungsbedingungen für die Messung mit dem Messgas {{gas}}
</dcc:content>
<dcc:content lang="en">
Ambient conditions for the measurement with the test gas {{gas}}
</dcc:content>
</dcc:name>
<dcc:data>
<dcc:list>
<dcc:name>
<dcc:content lang="de">
Die Kalibrierung wurde bei folgenden Umgebungsbedingungen ausgeführt
</dcc:content>
<dcc:content lang="en">
The calibration was carried out under the following ambient conditions
</dcc:content>
</dcc:name>
<dcc:list>
<dcc:quantity>
<dcc:name>
<dcc:content lang="de">Temperatur des Messgases</dcc:content>
<dcc:content lang="en">gas temperature</dcc:content>
</dcc:name>
<si:real>
{% set x = "??? GasTemperature ???" %}
{% if data.expansion is defined %}
{% if data.expansion.GasTemperature %}
{% set x = data.expansion.GasTemperature %}
{% endif %}
{% elif data.direct is defined %}
{% if data.direct.GasTemperature %}
{% set x = data.direct.GasTemperature %}
{% endif %}
{% endif %}
<si:value>{{x}}</si:value>
{% set x = "??? GasTemperatureUnit ???" %}
{% if data.expansion is defined %}
{% if data.expansion.GasTemperatureUnit == "K" %}
{% set x = "\kelvin" %}
{% elif data.expansion.GasTemperatureUnit == "C" %}
{% set x = "\degreeCelsius" %}
{% endif %}
{% elif data.direct is defined %}
{% if data.direct.GasTemperatureUnit == "K" %}
{% set x = "\kelvin" %}
{% elif data.direct.GasTemperatureUnit == "C" %}
{% set x = "\degreeCelsius" %}
{% endif %}
{% endif %}
<si:unit>{{x}}</si:unit>
{% set x = "??? GasTemperatureUncertainty ???" %}
{% if data.expansion is defined %}
{% if data.expansion.GasTemperatureUncertainty %}
{% set x = data.expansion.GasTemperatureUncertainty %}
{% endif %}
{% elif data.direct is defined %}
{% if data.direct.GasTemperatureUncertainty %}
{% set x = data.direct.GasTemperatureUncertainty %}
{% endif %}
{% endif %}
<si:expandedUnc>
<si:uncertainty>{{x}}</si:uncertainty>
<si:coverageFactor>2</si:coverageFactor>
<si:coverageProbability>0.95</si:coverageProbability>
</si:expandedUnc>
</si:real>
</dcc:quantity>
<dcc:quantity>
<dcc:name>
<dcc:content lang="de">Raumtemperatur</dcc:content>
<dcc:content lang="en">room temperature</dcc:content>
</dcc:name>
<si:real>
{% set x = "??? RoomTemperature ???" %}
{% if data.expansion is defined %}
{% if data.expansion.RoomTemperature %}
{% set x = data.expansion.RoomTemperature %}
{% endif %}
{% elif data.direct is defined %}
{% if data.direct.RoomTemperature %}
{% set x = data.direct.RoomTemperature %}
{% endif %}
{% endif %}
<si:value>{{x}}</si:value>
{% set x = "??? RoomTemperatureUnit ???" %}
{% if data.expansion is defined %}
{% if data.expansion.RoomTemperatureUnit == "K" %}
{% set x = "\kelvin" %}
{% elif data.expansion.RoomTemperatureUnit == "C" %}
{% set x = "\degreeCelsius" %}
{% endif %}
{% elif data.direct is defined %}
{% if data.direct.RoomTemperatureUnit == "K" %}
{% set x = "\kelvin" %}
{% elif data.direct.RoomTemperatureUnit == "C" %}
{% set x = "\degreeCelsius" %}
{% endif %}
{% endif %}
<si:unit>{{x}}</si:unit>
{% set x = "??? RoomTemperatureUncertainty ???" %}
{% if data.expansion is defined %}
{% if data.expansion.RoomTemperatureUncertainty %}
{% set x = data.expansion.RoomTemperatureUncertainty %}
{% endif %}
{% elif data.direct is defined %}
{% if data.direct.RoomTemperatureUncertainty %}
{% set x = data.direct.RoomTemperatureUncertainty %}
{% endif %}
{% endif %}
<si:expandedUnc>
<si:uncertainty>{{x}}</si:uncertainty>
<si:coverageFactor>2</si:coverageFactor>
<si:coverageProbability>0.95</si:coverageProbability>
</si:expandedUnc>
</si:real>
</dcc:quantity>
</dcc:list>
</dcc:list>
</dcc:data>
</dcc:influenceCondition>
{% endfor -%}
</dcc:influenceConditions>{% endautoescape %}
{% autoescape false %}<si:object>
<si:name>{{{doc.Titlepage.CalibrationObject}}}</si:name>
<si:type>{{{doc.Titlepage.Type}}}</si:type>
<si:mark>{{{doc.Titlepage.Certificate}}}</si:mark>
<si:serialNo>{{{doc.Titlepage.Serial}}}</si:serialNo>
<si:manufacturerName>{{{doc.Titlepage.Producer}}}</si:manufacturerName>
<si:manufacturerEmail></si:manufacturerEmail>
<si:manufacturerLocation lang="en">
<si:street></si:street>
<si:streetNo></si:streetNo>
<si:postCode></si:postCode>
<si:city></si:city>
<si:countryC>de</si:countryC>
</si:manufacturerLocation>
<si:manufacturerLocation lang="en">
<si:street></si:street>
<si:streetNo></si:streetNo>
<si:postCode></si:postCode>
<si:city></si:city>
<si:countryC>de</si:countryC>
</si:manufacturerLocation>
</si:object>{% endautoescape %}
{% autoescape false %}<si:owner>
<si:name lang="{{doc.Meta.lang}}">{{doc.Titlepage.Customer.Name}}</si:name>
<si:eMail></si:eMail>
<si:location lang="{{doc.Meta.lang}}">
<si:street>{{doc.Titlepage.Customer.Street}}</si:street>
<si:postCode>{{doc.Titlepage.Customer.Zipcode}}</si:postCode>
<si:city>{{doc.Titlepage.Customer.Town}}</si:city>
<si:countryC>{{doc.Titlepage.Customer.Land}}</si:countryC>
</si:location>
</si:owner>{% endautoescape %}
{% autoescape false %}<dcc:respPersons>
<dcc:respPerson id="Responsible">
<dcc:person>
<dcc:name>
<dcc:content>{{doc.Titlepage.ByOrder or "??? ???"}}</dcc:content>
</dcc:name>
<dcc:eMail>{{doc.Titlepage.ByOrderEmail}}</dcc:eMail>
</dcc:person>
<dcc:mainSigner>true</dcc:mainSigner>
</dcc:respPerson>
<dcc:respPerson id="Technician">
<dcc:person>
<dcc:name>
<dcc:content>{{doc.Titlepage.Examiner or "??? ???"}}</dcc:content>
</dcc:name>
<dcc:eMail>{{doc.Titlepage.ExaminerEmail}}</dcc:eMail>
</dcc:person>
</dcc:respPerson>
</dcc:respPersons>{% endautoescape %}
{%set helper = doc.Helper%}
{%set lang = doc.Meta["lang"]%}
<dcc:results>
{% for gas, table in doc.Table.items() -%}
{% for result_type, table in doc.Table[gas].items() -%}
{% for column in table -%}
{% if column.DCCOut -%}
<dcc:result>
<dcc:name>
<dcc:content lang="{{lang}}">
{{helper["gas_trans"][gas][lang]}}{{helper["meas_type_trans"][result_type][lang]}}
</dcc:content>
</dcc:name>
<dcc:description>
<dcc:content lang="en">
Name: {{column.Name}}, Quantity: {{column.Quantity}}
</dcc:content>
</dcc:description>
<dcc:data>
<dcc:list>
{% for val in column.Value %}
<dcc:quantity >
<si:real>
<si:value>{{column.Value[loop.index0]}}</si:value>
<si:unit>{{column.DCCUnit}}</si:unit>
<si:expandedUnc>
<si:uncertainty>{{column.Uncertainty[loop.index0]}}</si:uncertainty>
<si:coverageFactor>{{column.CoverageFactor}}</si:coverageFactor>
<si:coverageProbability>{{column.CoverageProbability}}</si:coverageProbability>
</si:expandedUnc>
</si:real>
</dcc:quantity>
{%endfor%}
</dcc:list>
</dcc:data>
</dcc:result>
{% endif -%}
{% endfor -%}
{% endfor -%}
{% endfor -%}
</dcc:results>
<dcc:usedMethods>
{%- for sec in doc.Section %}
<dcc:usedMethod>
<dcc:name>
<dcc:content>{{sec.Heading}}</dcc:content>
</dcc:name>
<dcc:description id="Method{{loop.index}}">
{%- for par in sec.Paragraph %}
{%- if par.Text %}
<dcc:content>
<![CDATA[
{{par.Text}}
]]>
</dcc:content>
{% endif -%}
{% endfor -%}
</dcc:description>
</dcc:usedMethod>
{% endfor -%}
</dcc:usedMethods>
{% autoescape false %}<dcc:dccSoftware>
<dcc:software>
<dcc:name>
<dcc:content>{{doc.ThisSoftware}}</dcc:content>
</dcc:name>
<dcc:release>{{doc.ThisRelease}}</dcc:release>
</dcc:software>
</dcc:dccSoftware>{% endautoescape %}
......@@ -4,69 +4,23 @@ import vl_dcc.utils as utils
import os
from prettierfier import prettify_xml
config = utils.config
git_cmd = utils.git_cmd
from pprint import pprint
class Trans:
gas_trans = {
"N2":{
"de" :"Stickstoff",
"en": "nitrogen",
"mol_weigth":"28.013"
},
"He":{
"de":"Helium",
"en": "helium"
},
"Ar":{
"de":"Argon",
"en":"argon"
}
}
meas_type_trans = {
"expansion":{
"de" :", Kalibrierung nach dem statischen Verfahren",
"en": ", static expansion method"
},
"se2_expansion":{
"de" :"",
"en": ""
},
"se2_expansion_direct":{
"de" :"",
"en": ""
},
"se2_expansion":{
"de" :"",
"en": ""
},
"direct":{
"de": ", Kalibrierung durch direkten Vergleich",
"en": ", direct comparison method"
},
"pressure_balance":{
"de": ", Kalibrierung durch Vergleich mit Druckwaage",
"en": ", comparison with pressure balance"
},
"rotary_piston_gauge":{
"de": ", Kalibrierung durch Vergleich mit Drehkolbenmanometer",
"en": ", comparison with rotary piston gauge"
}
}
def __init__(self, config, app, db):
self.xml_path = config['templates']['xml']
def cert_to_xml(self, cert_doc):
dcc_template = utils.path_file(path=self.xml_path, file='dcc.xml')
doc = cert_doc['Certificate']
doc["Helper"] = {"gas_trans":self.gas_trans, "meas_type_trans":self.meas_type_trans}
def cert_to_xml(cert_doc):
dcc_template = config['main_xml_template_file']
r = utils.git_cmd.config("--get", "remote.origin.url")
doc["ThisSoftware"] = r.split('/')[-1].split('.')[0]
doc["ThisRelease"] = utils.get_version()
pprint(doc)
xml = prettify_xml(render_template(dcc_template, doc=doc), indent=2, \
debug=False)
thisSoftware = r.split('/')[-1].split('.')[0]
thisRelease = utils.get_version()
print('====================================================')
#pprint(cert_doc)
#print(cert_doc['DCC'])
#print(cert_doc.DCC.administrativeData.calibrationLaboratory.contact[0].location.countryCode)
xml = prettify_xml(render_template(dcc_template, doc=cert_doc['DCC']), \
indent=2, debug=False)
return xml
......@@ -13,7 +13,7 @@ def set_filename_header(res, no):
res.headers['Access-Control-Expose-Headers'] = \
'filename, content-disposition, Server, Date, Content-Type'
res.headers['filename'] = '\"ks-{no}-{today}.xml\"'.format(no=no, today=today)
# TODO: today sinnvoll?
return res
def get_config_dict():
......@@ -46,3 +46,13 @@ def xml_response(xml_str):
def get_current_date(short=False):
return "{}".format(datetime.datetime.today().date())
def get_dcc_cert_doc(year_cert):
url = '{}{}'.format(config['cert_doc_url'], year_cert)
try:
r = requests.get(url)
d = r.json()
return d
except:
return {'error':'Cert document not accessible'}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment