(ProtobufCMessageInit) scf_line__init,
NULL,NULL,NULL /* reserved[123] */
};
-static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] =
+static const ProtobufCFieldDescriptor scf_epin__field_descriptors[27] =
{
{
"id",
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
- "V",
+ "v",
7,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_DOUBLE,
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
- "A",
+ "jv",
8,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_DOUBLE,
0, /* quantifier_offset */
- offsetof(ScfEpin, a),
+ offsetof(ScfEpin, jv),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
- "R",
+ "a",
9,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_DOUBLE,
0, /* quantifier_offset */
- offsetof(ScfEpin, r),
+ offsetof(ScfEpin, a),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
- "jR",
+ "ja",
10,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_DOUBLE,
0, /* quantifier_offset */
+ offsetof(ScfEpin, ja),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "r",
+ 11,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_DOUBLE,
+ 0, /* quantifier_offset */
+ offsetof(ScfEpin, r),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "jr",
+ 12,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_DOUBLE,
+ 0, /* quantifier_offset */
offsetof(ScfEpin, jr),
NULL,
NULL,
},
{
"uF",
- 11,
+ 13,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_DOUBLE,
0, /* quantifier_offset */
},
{
"uH",
- 12,
+ 14,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_DOUBLE,
0, /* quantifier_offset */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
- "tr",
- 13,
+ "hfe",
+ 15,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_DOUBLE,
0, /* quantifier_offset */
- offsetof(ScfEpin, tr),
+ offsetof(ScfEpin, hfe),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
- "jtr",
- 14,
+ "dr",
+ 16,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_DOUBLE,
+ 0, /* quantifier_offset */
+ offsetof(ScfEpin, dr),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "jdr",
+ 17,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_DOUBLE,
+ 0, /* quantifier_offset */
+ offsetof(ScfEpin, jdr),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "sr",
+ 18,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_DOUBLE,
+ 0, /* quantifier_offset */
+ offsetof(ScfEpin, sr),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "jsr",
+ 19,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_DOUBLE,
+ 0, /* quantifier_offset */
+ offsetof(ScfEpin, jsr),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "pr",
+ 20,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_DOUBLE,
+ 0, /* quantifier_offset */
+ offsetof(ScfEpin, pr),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "jpr",
+ 21,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_DOUBLE,
0, /* quantifier_offset */
- offsetof(ScfEpin, jtr),
+ offsetof(ScfEpin, jpr),
NULL,
NULL,
0, /* flags */
},
{
"x",
- 15,
+ 22,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_INT32,
0, /* quantifier_offset */
},
{
"y",
- 16,
+ 23,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_INT32,
0, /* quantifier_offset */
},
{
"vflag",
- 17,
+ 24,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_BOOL,
0, /* quantifier_offset */
},
{
"pflag",
- 18,
+ 25,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_BOOL,
0, /* quantifier_offset */
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
+ {
+ "vconst",
+ 26,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_BOOL,
+ 0, /* quantifier_offset */
+ offsetof(ScfEpin, vconst),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "aconst",
+ 27,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_BOOL,
+ 0, /* quantifier_offset */
+ offsetof(ScfEpin, aconst),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
};
static const unsigned scf_epin__field_indices_by_name[] = {
- 7, /* field[7] = A */
- 8, /* field[8] = R */
- 6, /* field[6] = V */
+ 8, /* field[8] = a */
+ 26, /* field[26] = aconst */
5, /* field[5] = c_lid */
1, /* field[1] = cid */
+ 15, /* field[15] = dr */
3, /* field[3] = flags */
+ 14, /* field[14] = hfe */
0, /* field[0] = id */
- 9, /* field[9] = jR */
- 13, /* field[13] = jtr */
+ 9, /* field[9] = ja */
+ 16, /* field[16] = jdr */
+ 20, /* field[20] = jpr */
+ 11, /* field[11] = jr */
+ 18, /* field[18] = jsr */
+ 7, /* field[7] = jv */
2, /* field[2] = lid */
- 17, /* field[17] = pflag */
+ 24, /* field[24] = pflag */
+ 19, /* field[19] = pr */
+ 10, /* field[10] = r */
+ 17, /* field[17] = sr */
4, /* field[4] = tos */
- 12, /* field[12] = tr */
- 10, /* field[10] = uF */
- 11, /* field[11] = uH */
- 16, /* field[16] = vflag */
- 14, /* field[14] = x */
- 15, /* field[15] = y */
+ 12, /* field[12] = uF */
+ 13, /* field[13] = uH */
+ 6, /* field[6] = v */
+ 25, /* field[25] = vconst */
+ 23, /* field[23] = vflag */
+ 21, /* field[21] = x */
+ 22, /* field[22] = y */
};
static const ProtobufCIntRange scf_epin__number_ranges[1 + 1] =
{
{ 1, 0 },
- { 0, 18 }
+ { 0, 27 }
};
const ProtobufCMessageDescriptor scf_epin__descriptor =
{
"ScfEpin",
"",
sizeof(ScfEpin),
- 18,
+ 27,
scf_epin__field_descriptors,
scf_epin__field_indices_by_name,
1, scf_epin__number_ranges,
(ProtobufCMessageInit) scf_econn__init,
NULL,NULL,NULL /* reserved[123] */
};
-static const ProtobufCFieldDescriptor scf_eline__field_descriptors[10] =
+static const ProtobufCFieldDescriptor scf_eline__field_descriptors[14] =
{
{
"id",
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
- "V",
+ "v",
8,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_DOUBLE,
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
- "A",
+ "jv",
9,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_DOUBLE,
0, /* quantifier_offset */
+ offsetof(ScfEline, jv),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "a",
+ 10,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_DOUBLE,
+ 0, /* quantifier_offset */
offsetof(ScfEline, a),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
+ {
+ "ja",
+ 11,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_DOUBLE,
+ 0, /* quantifier_offset */
+ offsetof(ScfEline, ja),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "vconst",
+ 12,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_BOOL,
+ 0, /* quantifier_offset */
+ offsetof(ScfEline, vconst),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "aconst",
+ 13,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_BOOL,
+ 0, /* quantifier_offset */
+ offsetof(ScfEline, aconst),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
{
"vflag",
- 10,
+ 14,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_BOOL,
0, /* quantifier_offset */
},
};
static const unsigned scf_eline__field_indices_by_name[] = {
- 8, /* field[8] = A */
- 7, /* field[7] = V */
+ 9, /* field[9] = a */
+ 12, /* field[12] = aconst */
2, /* field[2] = c_pins */
5, /* field[5] = conns */
4, /* field[4] = dfo */
3, /* field[3] = flags */
0, /* field[0] = id */
+ 10, /* field[10] = ja */
+ 8, /* field[8] = jv */
6, /* field[6] = lines */
1, /* field[1] = pins */
- 9, /* field[9] = vflag */
+ 7, /* field[7] = v */
+ 11, /* field[11] = vconst */
+ 13, /* field[13] = vflag */
};
static const ProtobufCIntRange scf_eline__number_ranges[1 + 1] =
{
{ 1, 0 },
- { 0, 10 }
+ { 0, 14 }
};
const ProtobufCMessageDescriptor scf_eline__descriptor =
{
"ScfEline",
"",
sizeof(ScfEline),
- 10,
+ 14,
scf_eline__field_descriptors,
scf_eline__field_indices_by_name,
1, scf_eline__number_ranges,
(ProtobufCMessageInit) scf_eline__init,
NULL,NULL,NULL /* reserved[123] */
};
-static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] =
+static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[19] =
{
{
"id",
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
- "V",
+ "v",
5,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_DOUBLE,
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
- "A",
+ "jv",
6,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_DOUBLE,
0, /* quantifier_offset */
- offsetof(ScfEcomponent, a),
+ offsetof(ScfEcomponent, jv),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
- "R",
+ "a",
7,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_DOUBLE,
0, /* quantifier_offset */
- offsetof(ScfEcomponent, r),
+ offsetof(ScfEcomponent, a),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
- "jR",
+ "ja",
8,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_DOUBLE,
0, /* quantifier_offset */
+ offsetof(ScfEcomponent, ja),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "r",
+ 9,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_DOUBLE,
+ 0, /* quantifier_offset */
+ offsetof(ScfEcomponent, r),
+ NULL,
+ NULL,
+ 0, /* flags */
+ 0,NULL,NULL /* reserved1,reserved2, etc */
+ },
+ {
+ "jr",
+ 10,
+ PROTOBUF_C_LABEL_REQUIRED,
+ PROTOBUF_C_TYPE_DOUBLE,
+ 0, /* quantifier_offset */
offsetof(ScfEcomponent, jr),
NULL,
NULL,
},
{
"uF",
- 9,
+ 11,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_DOUBLE,
0, /* quantifier_offset */
},
{
"uH",
- 10,
+ 12,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_DOUBLE,
0, /* quantifier_offset */
},
{
"dfo",
- 11,
+ 13,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_INT64,
0, /* quantifier_offset */
},
{
"status",
- 12,
+ 14,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_INT32,
0, /* quantifier_offset */
},
{
"x",
- 13,
+ 15,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_INT32,
0, /* quantifier_offset */
},
{
"y",
- 14,
+ 16,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_INT32,
0, /* quantifier_offset */
},
{
"w",
- 15,
+ 17,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_INT32,
0, /* quantifier_offset */
},
{
"h",
- 16,
+ 18,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_INT32,
0, /* quantifier_offset */
},
{
"vflag",
- 17,
+ 19,
PROTOBUF_C_LABEL_REQUIRED,
PROTOBUF_C_TYPE_BOOL,
0, /* quantifier_offset */
},
};
static const unsigned scf_ecomponent__field_indices_by_name[] = {
- 5, /* field[5] = A */
- 6, /* field[6] = R */
- 4, /* field[4] = V */
- 10, /* field[10] = dfo */
- 15, /* field[15] = h */
+ 6, /* field[6] = a */
+ 12, /* field[12] = dfo */
+ 17, /* field[17] = h */
0, /* field[0] = id */
- 7, /* field[7] = jR */
+ 7, /* field[7] = ja */
+ 9, /* field[9] = jr */
+ 5, /* field[5] = jv */
2, /* field[2] = model */
3, /* field[3] = pins */
- 11, /* field[11] = status */
+ 8, /* field[8] = r */
+ 13, /* field[13] = status */
1, /* field[1] = type */
- 8, /* field[8] = uF */
- 9, /* field[9] = uH */
- 16, /* field[16] = vflag */
- 14, /* field[14] = w */
- 12, /* field[12] = x */
- 13, /* field[13] = y */
+ 10, /* field[10] = uF */
+ 11, /* field[11] = uH */
+ 4, /* field[4] = v */
+ 18, /* field[18] = vflag */
+ 16, /* field[16] = w */
+ 14, /* field[14] = x */
+ 15, /* field[15] = y */
};
static const ProtobufCIntRange scf_ecomponent__number_ranges[1 + 1] =
{
{ 1, 0 },
- { 0, 17 }
+ { 0, 19 }
};
const ProtobufCMessageDescriptor scf_ecomponent__descriptor =
{
"ScfEcomponent",
"",
sizeof(ScfEcomponent),
- 17,
+ 19,
scf_ecomponent__field_descriptors,
scf_ecomponent__field_indices_by_name,
1, scf_ecomponent__number_ranges,
static scf_edata_t component_datas[] =
{
- {SCF_EDA_None, 0, 0, 0, 0, 0, 0, 0, 0},
- {SCF_EDA_Battery, 0, SCF_EDA_Battery_POS, 0, 0, 0, 0, 0, 0},
+ {SCF_EDA_None, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {SCF_EDA_Battery, 0, SCF_EDA_Battery_POS, 0, 0, 0, 0, 0, 0, 0},
- {SCF_EDA_Resistor, 0, 0, 0, 0, 10 * 1000, 0, 0, 0},
- {SCF_EDA_Capacitor, 0, 0, 0, 0, 0, 0, 0.1, 0},
- {SCF_EDA_Inductor, 0, 0, 0, 0, 0, 0, 0, 1000},
+ {SCF_EDA_Resistor, 0, 0, 0, 0, 10 * 1000, 0, 0, 0, 0},
+ {SCF_EDA_Capacitor, 0, 0, 0, 0, 0, 0, 0.1, 0, 0},
+ {SCF_EDA_Inductor, 0, 0, 0, 0, 0, 0, 0, 1000, 0},
+};
+
+static scf_edata_t pin_datas[] =
+{
+ {SCF_EDA_None, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {SCF_EDA_Diode, 0, SCF_EDA_Diode_NEG, 0, 0, 750, 0, 0, 0},
- {SCF_EDA_Transistor, 0, SCF_EDA_Transistor_B, 0, 0, 750, 0, 0, 0},
- {SCF_EDA_Transistor, 0, SCF_EDA_Transistor_C, 0, 0, 750, 0, 0, 0},
+ {SCF_EDA_Diode, 0, SCF_EDA_Diode_NEG, 0, 0, 750, 0, 0, 0, 0},
+ {SCF_EDA_Transistor, 0, SCF_EDA_Transistor_B, 0, 0, 750, 0, 0, 0, 0},
+ {SCF_EDA_Transistor, 0, SCF_EDA_Transistor_C, 0, 0, 750, 0, 0, 0, 100},
};
-static scf_edata_t* _eda_find_data(const uint64_t type, const uint64_t model, const uint64_t pid)
+static scf_edata_t* _pin_find_data(const uint64_t type, const uint64_t model, const uint64_t pid)
+{
+ scf_edata_t* ed;
+
+ int i;
+ for (i = 0; i < sizeof(pin_datas) / sizeof(pin_datas[0]); i++) {
+ ed = &pin_datas[i];
+
+ if (ed->type == type && ed->model == model && ed->pid == pid)
+ return ed;
+ }
+
+ return NULL;
+}
+
+static scf_edata_t* _component_find_data(const uint64_t type, const uint64_t model)
{
scf_edata_t* ed;
for (i = 0; i < sizeof(component_datas) / sizeof(component_datas[0]); i++) {
ed = &component_datas[i];
- if (ed->type == type && ed->model == model && ed->pid == pid)
+ if (ed->type == type && ed->model == model)
return ed;
}
c->type = type;
+ ed = _component_find_data(c->type, c->model);
+ if (ed) {
+ c->v = ed->v;
+ c->a = ed->a;
+ c->r = ed->r;
+ c->jr = ed->jr;
+ c->uf = ed->uf;
+ c->uh = ed->uh;
+ }
+
int i;
for (i = 0; i < component_pins[type]; i++) {
return NULL;
}
- ed = _eda_find_data(c->type, c->model, pin->id);
+ ed = _pin_find_data(c->type, c->model, pin->id);
if (ed) {
- pin->v = ed->v;
- pin->a = ed->a;
- pin->r = ed->r;
- pin->jr = ed->jr;
- pin->uf = ed->uf;
- pin->uh = ed->uh;
+ pin->v = ed->v;
+ pin->a = ed->a;
+ pin->r = ed->r;
+ pin->jr = ed->jr;
+ pin->uf = ed->uf;
+ pin->uh = ed->uh;
+ pin->hfe = ed->hfe;
}
}