| 1 |
/* |
| 2 |
* Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions |
| 3 |
* of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with |
| 4 |
* NTESS, the U.S. Government retains certain rights in this software. |
| 5 |
* |
| 6 |
* See packages/seacas/LICENSE for details |
| 7 |
*/ |
| 8 |
/* devid.h - these functions are used to map SVDI device code numbers |
| 9 |
* to device code character strings and vice versa |
| 10 |
*/ |
| 11 |
#pragma once |
| 12 |
|
| 13 |
struct device_ids |
| 14 |
{ |
| 15 |
char *devid_char; |
| 16 |
float devid_num; |
| 17 |
}; |
| 18 |
|
| 19 |
/* to add new devices to this table: increment MAX_DEVID value |
| 20 |
add to table per example below */ |
| 21 |
#define MAX_DEVID 74 |
| 22 |
static struct device_ids device_values[MAX_DEVID] = { |
| 23 |
{"tk4", 1.}, {"tk6", 1.1}, {"tek", 1.2}, {"tp2", 1.3}, {"tp8", 1.4}, {"t14", 1.5}, |
| 24 |
{"t13", 1.6}, {"t05", 1.7}, {"t07", 1.8}, {"t15", 1.9}, {"16c", 2.1}, {"16b", 2.2}, |
| 25 |
{"35c", 2.3}, {"3mc", 2.31}, {"810", 2.32}, {"35b", 2.4}, {"3mb", 2.41}, {"35a", 2.5}, |
| 26 |
{"24l", 2.6}, {"48l", 2.7}, {"csq", 2.8}, {"bsq", 2.9}, {"r94", 3.}, {"t27", 4.}, |
| 27 |
{"t25", 4.1}, {"alp", 5.}, {"hc1", 6.}, {"lxy", 7.}, {"tst", 8.}, {"v25", 9.}, |
| 28 |
{"v40", 9.1}, {"v41", 9.2}, {"v34", 9.21}, {"aed", 10.}, {"ae7", 10.1}, {"ae1", 10.2}, |
| 29 |
{"met", 11.}, {"hpp", 12.}, {"h75", 12.1}, {"h72", 12.2}, {"h74", 12.3}, {"h50", 12.4}, |
| 30 |
{"ret", 14.}, {"ap5", 15.}, {"jp7", 16.}, {"jp1", 16.1}, {"ger", 17.}, {"xyn", 18.}, |
| 31 |
{"ps3", 20.}, {"qms", 21.}, {"c51", 22.}, {"c10", 22.1}, {"r25", 23.}, {"r38", 23.1}, |
| 32 |
{"f3c", 23.2}, {"f3m", 23.3}, {"f16", 23.4}, {"fsq", 23.5}, {"f8t", 23.6}, {"qlf", 24.}, |
| 33 |
{"q35", 24.1}, {"t45", 25.}, {"ls5", 26.}, {"i10", 27.}, {"i30", 27.1}, {"btk", 28.}, |
| 34 |
{"ln3", 29.}, {"a60", 30.}, {"sun", 31.}, {"uis", 31.1}, {"ult", 32.}, {"tal", 33.}, |
| 35 |
{"nws", 34.}, {"x10", 35.}}; |
| 36 |
|
| 37 |
#if !defined(NO_GET_DEVID_CHAR) |
| 38 |
/* * |
| 39 |
* function get_devid_char will return a pointer to the character string * |
| 40 |
* associated with a floating point number for cgid inquiries. * |
| 41 |
* INPUT: a pointer to the 3 character string * |
| 42 |
* RETURN: floating point device number * |
| 43 |
* */ |
| 44 |
static char *get_devid_char(float number) |
| 45 |
{ |
| 46 |
int i; |
| 47 |
|
| 48 |
for (i = 0; i < MAX_DEVID; i++) { |
| 49 |
if (device_values[i].devid_num == number) { |
| 50 |
return (device_values[i].devid_char); |
| 51 |
} |
| 52 |
} |
| 53 |
|
| 54 |
/* return a null pointer if there is no floating point number match */ |
| 55 |
return (0); |
| 56 |
} |
| 57 |
#endif |