From f605c7a675af1508fcc286e329bc31b02e8670f0 Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Thu, 7 Sep 2023 22:35:28 +0800 Subject: [PATCH] update 'native/eda/scf_eda.proto' --- native/eda/scf_eda.pb-c.c | 341 ++++++++++++++++++++++++++++++-------- native/eda/scf_eda.pb-c.h | 25 ++- native/eda/scf_eda.proto | 80 +++++---- native/eda/scf_eda_pb.c | 65 ++++++-- native/eda/scf_eda_pb.h | 12 ++ 5 files changed, 398 insertions(+), 125 deletions(-) diff --git a/native/eda/scf_eda.pb-c.c b/native/eda/scf_eda.pb-c.c index 55150a6..ff59055 100644 --- a/native/eda/scf_eda.pb-c.c +++ b/native/eda/scf_eda.pb-c.c @@ -385,7 +385,7 @@ const ProtobufCMessageDescriptor scf_line__descriptor = (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", @@ -460,7 +460,7 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "V", + "v", 7, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, @@ -472,35 +472,59 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = 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, @@ -509,7 +533,7 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = }, { "uF", - 11, + 13, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ @@ -521,7 +545,7 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = }, { "uH", - 12, + 14, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ @@ -532,24 +556,84 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = 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 */ @@ -557,7 +641,7 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = }, { "x", - 15, + 22, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ @@ -569,7 +653,7 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = }, { "y", - 16, + 23, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ @@ -581,7 +665,7 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = }, { "vflag", - 17, + 24, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ @@ -593,7 +677,7 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = }, { "pflag", - 18, + 25, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ @@ -603,31 +687,64 @@ static const ProtobufCFieldDescriptor scf_epin__field_descriptors[18] = 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 = { @@ -637,7 +754,7 @@ 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, @@ -695,7 +812,7 @@ const ProtobufCMessageDescriptor scf_econn__descriptor = (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", @@ -782,7 +899,7 @@ static const ProtobufCFieldDescriptor scf_eline__field_descriptors[10] = 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "V", + "v", 8, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, @@ -794,20 +911,68 @@ static const ProtobufCFieldDescriptor scf_eline__field_descriptors[10] = 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 */ @@ -819,21 +984,25 @@ static const ProtobufCFieldDescriptor scf_eline__field_descriptors[10] = }, }; 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 = { @@ -843,14 +1012,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", @@ -901,7 +1070,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "V", + "v", 5, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, @@ -913,35 +1082,59 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = 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, @@ -950,7 +1143,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "uF", - 9, + 11, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ @@ -962,7 +1155,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "uH", - 10, + 12, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_DOUBLE, 0, /* quantifier_offset */ @@ -974,7 +1167,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "dfo", - 11, + 13, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_INT64, 0, /* quantifier_offset */ @@ -986,7 +1179,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "status", - 12, + 14, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ @@ -998,7 +1191,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "x", - 13, + 15, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ @@ -1010,7 +1203,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "y", - 14, + 16, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ @@ -1022,7 +1215,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "w", - 15, + 17, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ @@ -1034,7 +1227,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "h", - 16, + 18, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_INT32, 0, /* quantifier_offset */ @@ -1046,7 +1239,7 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, { "vflag", - 17, + 19, PROTOBUF_C_LABEL_REQUIRED, PROTOBUF_C_TYPE_BOOL, 0, /* quantifier_offset */ @@ -1058,28 +1251,30 @@ static const ProtobufCFieldDescriptor scf_ecomponent__field_descriptors[17] = }, }; 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 = { @@ -1089,7 +1284,7 @@ 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, diff --git a/native/eda/scf_eda.pb-c.h b/native/eda/scf_eda.pb-c.h index 6bd25ac..db9998a 100644 --- a/native/eda/scf_eda.pb-c.h +++ b/native/eda/scf_eda.pb-c.h @@ -53,21 +53,30 @@ struct _ScfEpin uint64_t *tos; uint64_t c_lid; double v; + double jv; double a; + double ja; double r; double jr; double uf; double uh; - double tr; - double jtr; + double hfe; + double dr; + double jdr; + double sr; + double jsr; + double pr; + double jpr; int32_t x; int32_t y; protobuf_c_boolean vflag; protobuf_c_boolean pflag; + protobuf_c_boolean vconst; + protobuf_c_boolean aconst; }; #define SCF_EPIN__INIT \ { PROTOBUF_C_MESSAGE_INIT (&scf_epin__descriptor) \ - , 0, 0, 0, 0, 0,NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + , 0, 0, 0, 0, 0,NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } struct _ScfEconn @@ -96,12 +105,16 @@ struct _ScfEline size_t n_lines; ScfLine **lines; double v; + double jv; double a; + double ja; + protobuf_c_boolean vconst; + protobuf_c_boolean aconst; protobuf_c_boolean vflag; }; #define SCF_ELINE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&scf_eline__descriptor) \ - , 0, 0,NULL, 0, 0, 0, 0,NULL, 0,NULL, 0, 0, 0 } + , 0, 0,NULL, 0, 0, 0, 0,NULL, 0,NULL, 0, 0, 0, 0, 0, 0, 0 } struct _ScfEcomponent @@ -113,7 +126,9 @@ struct _ScfEcomponent size_t n_pins; ScfEpin **pins; double v; + double jv; double a; + double ja; double r; double jr; double uf; @@ -128,7 +143,7 @@ struct _ScfEcomponent }; #define SCF_ECOMPONENT__INIT \ { PROTOBUF_C_MESSAGE_INIT (&scf_ecomponent__descriptor) \ - , 0, 0, 0, 0,NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + , 0, 0, 0, 0,NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } struct _ScfEfunction diff --git a/native/eda/scf_eda.proto b/native/eda/scf_eda.proto index c68bc6a..e4d6fd3 100644 --- a/native/eda/scf_eda.proto +++ b/native/eda/scf_eda.proto @@ -17,20 +17,33 @@ message scf_epin repeated uint64 tos = 5; required uint64 c_lid = 6; - required double V = 7; - required double A = 8; - required double R = 9; - required double jR = 10; - required double uF = 11; - required double uH = 12; - - required double tr = 13; - required double jtr = 14; - - required int32 x = 15; - required int32 y = 16; - required bool vflag = 17; - required bool pflag = 18; + required double v = 7; + required double jv = 8; + required double a = 9; + required double ja = 10; + + required double r = 11; + required double jr = 12; + required double uF = 13; + required double uH = 14; + required double hfe = 15; + + required double dr = 16; + required double jdr = 17; + + required double sr = 18; + required double jsr = 19; + + required double pr = 20; + required double jpr = 21; + + required int32 x = 22; + required int32 y = 23; + required bool vflag = 24; + required bool pflag = 25; + + required bool vconst = 26; + required bool aconst = 27; } message scf_econn @@ -50,10 +63,14 @@ message scf_eline repeated scf_econn conns = 6; repeated scf_line lines = 7; - required double V = 8; - required double A = 9; + required double v = 8; + required double jv = 9; + required double a = 10; + required double ja = 11; + required bool vconst = 12; + required bool aconst = 13; - required bool vflag = 10; + required bool vflag = 14; } message scf_ecomponent @@ -63,22 +80,25 @@ message scf_ecomponent required uint64 model = 3; repeated scf_epin pins = 4; - required double V = 5; - required double A = 6; - required double R = 7; - required double jR = 8; - required double uF = 9; - required double uH = 10; + required double v = 5; + required double jv = 6; + required double a = 7; + required double ja = 8; + + required double r = 9; + required double jr = 10; + required double uF = 11; + required double uH = 12; - required int64 dfo = 11; - required int32 status = 12; + required int64 dfo = 13; + required int32 status = 14; - required int32 x = 13; - required int32 y = 14; - required int32 w = 15; - required int32 h = 16; + required int32 x = 15; + required int32 y = 16; + required int32 w = 17; + required int32 h = 18; - required bool vflag = 17; + required bool vflag = 19; } message scf_efunction diff --git a/native/eda/scf_eda_pb.c b/native/eda/scf_eda_pb.c index 5b86907..c5ec14c 100644 --- a/native/eda/scf_eda_pb.c +++ b/native/eda/scf_eda_pb.c @@ -16,19 +16,39 @@ static int component_pins[SCF_EDA_Components_NB] = 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; @@ -36,7 +56,7 @@ static scf_edata_t* _eda_find_data(const uint64_t type, const uint64_t model, co 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; } @@ -387,6 +407,16 @@ ScfEcomponent* scf_ecomponent__alloc(uint64_t type) 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++) { @@ -404,14 +434,15 @@ ScfEcomponent* scf_ecomponent__alloc(uint64_t type) 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; } } diff --git a/native/eda/scf_eda_pb.h b/native/eda/scf_eda_pb.h index 9aa491b..8f2aecf 100644 --- a/native/eda/scf_eda_pb.h +++ b/native/eda/scf_eda_pb.h @@ -23,6 +23,10 @@ enum { #define SCF_EDA_PIN_POS 4 #define SCF_EDA_PIN_NEG 8 +#define SCF_EDA_V_INIT -10001001.0 +#define SCF_EDA_V_MIN -10000000.0 +#define SCF_EDA_V_MAX 10000000.0 + enum { SCF_EDA_Battery_NEG, SCF_EDA_Battery_POS, @@ -35,6 +39,13 @@ enum { SCF_EDA_Diode_NB, }; +enum { + SCF_EDA_Status_ON, + SCF_EDA_Status_OFF, + SCF_EDA_Path_OFF, + SCF_EDA_Path_TO, +}; + enum { SCF_EDA_Transistor_B, SCF_EDA_Transistor_E, @@ -53,6 +64,7 @@ typedef struct { double jr; double uf; double uh; + double hfe; } scf_edata_t; -- 2.25.1