OCT 1. 更新测试工具界面

This commit is contained in:
huangxin 2023-04-20 17:48:19 +08:00
parent 2719023967
commit b68a2f2637
3 changed files with 46 additions and 46 deletions

View File

@ -18,6 +18,7 @@ typedef enum {
COL_RESULT, COL_RESULT,
COL_STATUS, COL_STATUS,
COL_ATTR_EDITABLE,
NUM_COLS NUM_COLS
} COL_NAME; } COL_NAME;

View File

@ -54,14 +54,12 @@ static double calc_total_progress(PDHCP_INFO pInfo) {
return pre_cnt; return pre_cnt;
} }
static double calc_step_progress(PDHCP_INFO pInfo, DHCP_STEP step) { static gboolean calc_step_progress(PDHCP_INFO pInfo, DHCP_STEP step) {
double pre_cnt = 0.0;
if (pInfo && pInfo->step == step) { if (pInfo && pInfo->step == step) {
pre_cnt += pInfo->status * 5; return TRUE;
} }
return pre_cnt; return FALSE;
} }
static void tree_view_data_store_create() { static void tree_view_data_store_create() {
@ -99,6 +97,7 @@ static void tree_view_data_store_create() {
COL_ACK, calc_step_progress(pInfo, STEP_ACK), COL_ACK, calc_step_progress(pInfo, STEP_ACK),
COL_RESULT, "", COL_RESULT, "",
COL_STATUS, calc_total_progress(pInfo), COL_STATUS, calc_total_progress(pInfo),
COL_ATTR_EDITABLE, FALSE,
-1); -1);
// clang-format on // clang-format on
} }
@ -179,6 +178,7 @@ static gboolean tree_view_data_store_upgade(gpointer pInfo) {
COL_ACK, calc_step_progress(pInfo, STEP_ACK), COL_ACK, calc_step_progress(pInfo, STEP_ACK),
COL_RESULT, "", COL_RESULT, "",
COL_STATUS, calc_total_progress(pInfo), COL_STATUS, calc_total_progress(pInfo),
COL_ATTR_EDITABLE, FALSE,
-1); -1);
// clang-format on // clang-format on
} }
@ -397,7 +397,7 @@ int main(int args, char **argv) {
GtkWidget *macTxt = GTK_WIDGET(gtk_builder_get_object(g_mainBuilder, "txtMacStart")); GtkWidget *macTxt = GTK_WIDGET(gtk_builder_get_object(g_mainBuilder, "txtMacStart"));
GtkWidget *numInc = GTK_WIDGET(gtk_builder_get_object(g_mainBuilder, "sbReqNum")); GtkWidget *numInc = GTK_WIDGET(gtk_builder_get_object(g_mainBuilder, "sbReqNum"));
GtkAdjustment *adj = gtk_adjustment_new(1000, 1, 100000, 1, 0, 0); GtkAdjustment *adj = gtk_adjustment_new(1, 1, 100000, 1, 0, 0);
gtk_spin_button_set_adjustment(GTK_SPIN_BUTTON(numInc), adj); gtk_spin_button_set_adjustment(GTK_SPIN_BUTTON(numInc), adj);
GtkWidget *numVni = GTK_WIDGET(gtk_builder_get_object(g_mainBuilder, "sbVni")); GtkWidget *numVni = GTK_WIDGET(gtk_builder_get_object(g_mainBuilder, "sbVni"));

View File

@ -2,6 +2,12 @@
<interface> <interface>
<requires lib="gtk+" version="2.16"/> <requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide --> <!-- interface-naming-policy project-wide -->
<object class="GtkListStore" id="lsNicName">
<columns>
<!-- column-name cNicName -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkListStore" id="tsDhcpInfo"> <object class="GtkListStore" id="tsDhcpInfo">
<columns> <columns>
<!-- column-name cIndex --> <!-- column-name cIndex -->
@ -11,23 +17,19 @@
<!-- column-name cHostname --> <!-- column-name cHostname -->
<column type="gchararray"/> <column type="gchararray"/>
<!-- column-name cDiscover --> <!-- column-name cDiscover -->
<column type="gfloat"/> <column type="gboolean"/>
<!-- column-name cOffer --> <!-- column-name cOffer -->
<column type="gfloat"/> <column type="gboolean"/>
<!-- column-name cRequest --> <!-- column-name cRequest -->
<column type="gfloat"/> <column type="gboolean"/>
<!-- column-name cAck --> <!-- column-name cAck -->
<column type="gfloat"/> <column type="gboolean"/>
<!-- column-name cResult --> <!-- column-name cResult -->
<column type="gchararray"/> <column type="gchararray"/>
<!-- column-name cRltPrgess --> <!-- column-name cRltPrgess -->
<column type="gfloat"/> <column type="gfloat"/>
</columns> <!-- column-name cAttrPrgTest -->
</object> <column type="gboolean"/>
<object class="GtkListStore" id="lsNicName">
<columns>
<!-- column-name cNicName -->
<column type="gchararray"/>
</columns> </columns>
</object> </object>
<object class="GtkWindow" id="wndMain"> <object class="GtkWindow" id="wndMain">
@ -389,7 +391,6 @@
<property name="enable_grid_lines">both</property> <property name="enable_grid_lines">both</property>
<child> <child>
<object class="GtkTreeViewColumn" id="tvcIndex"> <object class="GtkTreeViewColumn" id="tvcIndex">
<property name="min_width">32</property>
<property name="title">Index</property> <property name="title">Index</property>
<property name="alignment">0.5</property> <property name="alignment">0.5</property>
<child> <child>
@ -402,7 +403,6 @@
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="tvcMac"> <object class="GtkTreeViewColumn" id="tvcMac">
<property name="min_width">128</property>
<property name="title">MAC</property> <property name="title">MAC</property>
<property name="alignment">0.5</property> <property name="alignment">0.5</property>
<child> <child>
@ -415,7 +415,6 @@
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="tvcHostname"> <object class="GtkTreeViewColumn" id="tvcHostname">
<property name="min_width">64</property>
<property name="title">Hostname</property> <property name="title">Hostname</property>
<property name="alignment">0.5</property> <property name="alignment">0.5</property>
<child> <child>
@ -428,58 +427,60 @@
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="tvcDiscover"> <object class="GtkTreeViewColumn" id="tvcDiscover">
<property name="sizing">autosize</property> <property name="sizing">fixed</property>
<property name="fixed_width">64</property> <property name="fixed_width">32</property>
<property name="min_width">96</property> <property name="title">D</property>
<property name="title">Discover</property>
<property name="alignment">0.5</property> <property name="alignment">0.5</property>
<child> <child>
<object class="GtkCellRendererProgress" id="crDiscover"/> <object class="GtkCellRendererToggle" id="crDiscover"/>
<attributes> <attributes>
<attribute name="value">3</attribute> <attribute name="sensitive">9</attribute>
<attribute name="active">3</attribute>
</attributes> </attributes>
</child> </child>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="tvcOffer"> <object class="GtkTreeViewColumn" id="tvcOffer">
<property name="sizing">autosize</property> <property name="sizing">fixed</property>
<property name="fixed_width">64</property> <property name="fixed_width">32</property>
<property name="min_width">96</property> <property name="title">O</property>
<property name="title">Offer</property>
<property name="alignment">0.5</property> <property name="alignment">0.5</property>
<child> <child>
<object class="GtkCellRendererProgress" id="crOffer"/> <object class="GtkCellRendererToggle" id="crOffer"/>
<attributes> <attributes>
<attribute name="value">4</attribute> <attribute name="sensitive">9</attribute>
<attribute name="active">4</attribute>
</attributes> </attributes>
</child> </child>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="tvcRequest"> <object class="GtkTreeViewColumn" id="tvcRequest">
<property name="sizing">autosize</property> <property name="sizing">fixed</property>
<property name="min_width">96</property> <property name="fixed_width">32</property>
<property name="title">Request</property> <property name="title">R</property>
<property name="alignment">0.5</property> <property name="alignment">0.5</property>
<child> <child>
<object class="GtkCellRendererProgress" id="crRequest"/> <object class="GtkCellRendererToggle" id="crRequest"/>
<attributes> <attributes>
<attribute name="value">5</attribute> <attribute name="sensitive">9</attribute>
<attribute name="active">5</attribute>
</attributes> </attributes>
</child> </child>
</object> </object>
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="tvcAck"> <object class="GtkTreeViewColumn" id="tvcAck">
<property name="sizing">autosize</property> <property name="sizing">fixed</property>
<property name="min_width">96</property> <property name="fixed_width">32</property>
<property name="title">ACK</property> <property name="title">A</property>
<property name="alignment">0.5</property> <property name="alignment">0.5</property>
<child> <child>
<object class="GtkCellRendererProgress" id="crAck"/> <object class="GtkCellRendererToggle" id="crAck"/>
<attributes> <attributes>
<attribute name="value">6</attribute> <attribute name="sensitive">9</attribute>
<attribute name="active">6</attribute>
</attributes> </attributes>
</child> </child>
</object> </object>
@ -487,7 +488,7 @@
<child> <child>
<object class="GtkTreeViewColumn" id="tvcResult"> <object class="GtkTreeViewColumn" id="tvcResult">
<property name="sizing">fixed</property> <property name="sizing">fixed</property>
<property name="min_width">200</property> <property name="fixed_width">400</property>
<property name="title">Result</property> <property name="title">Result</property>
<property name="alignment">0.5</property> <property name="alignment">0.5</property>
<child> <child>
@ -501,10 +502,8 @@
<child> <child>
<object class="GtkTreeViewColumn" id="tblStatus"> <object class="GtkTreeViewColumn" id="tblStatus">
<property name="sizing">fixed</property> <property name="sizing">fixed</property>
<property name="fixed_width">64</property> <property name="fixed_width">32</property>
<property name="min_width">64</property> <property name="title">Progress</property>
<property name="max_width">64</property>
<property name="title">Totol Progress</property>
<property name="alignment">0.5</property> <property name="alignment">0.5</property>
<child> <child>
<object class="GtkCellRendererProgress" id="cellrendererprogress1"/> <object class="GtkCellRendererProgress" id="cellrendererprogress1"/>