Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/drivers/comedi/drivers/ni_routing/tools/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 1 kB image not shown  

Quelle  ni_names.py   Sprache: Python

 
# SPDX-License-Identifier: GPL-2.0+
"""
This file helps to extract string names of NI signals as included in comedi.h
between NI_NAMES_BASE and NI_NAMES_BASE+NI_NUM_NAMES.
"""

# This is simply to aide in creating the entries in the order of the value of
# the device-global NI signal/terminal constants defined in comedi.h
import comedi_h


ni_macros = (
  'NI_PFI',
  'TRIGGER_LINE',
  'NI_RTSI_BRD',
  'NI_CtrSource',
  'NI_CtrGate',
  'NI_CtrAux',
  'NI_CtrA',
  'NI_CtrB',
  'NI_CtrZ',
  'NI_CtrArmStartTrigger',
  'NI_CtrInternalOutput',
  'NI_CtrOut',
  'NI_CtrSampleClock',
)

def get_ni_names():
  name_dict = dict()

  # load all the static names; start with those that do not begin with NI_
  name_dict['PXI_Star'] = comedi_h.PXI_Star
  name_dict['PXI_Clk10'] = comedi_h.PXI_Clk10

  #load all macro values
  for fun in ni_macros:
    f = getattr(comedi_h, fun)
    name_dict.update({
      '{}({})'.format(fun,i):f(i) for i in range(1 + f(-1) - f(0))
    })

  #load everything else in ni_common_signal_names enum
  name_dict.update({
    k:v for k,v in comedi_h.__dict__.items()
    if k.startswith('NI_'and (not callable(v)) and
       comedi_h.NI_COUNTER_NAMES_MAX < v < (comedi_h.NI_NAMES_BASE + comedi_h.NI_NUM_NAMES)
  })

  # now create reverse lookup (value -> name)

  val_dict = {v:k for k,v in name_dict.items()}

  return name_dict, val_dict

name_to_value, value_to_name = get_ni_names()

Messung V0.5
C=88 H=56 G=73

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.