From 21542377e249415041883e7c91e041602e9edfdd Mon Sep 17 00:00:00 2001 From: pavanvpatil Date: Wed, 17 Aug 2022 17:07:23 +0530 Subject: [PATCH] added utility tools button to main pages --- iPDC/Makefile | 7 +- iPDC/iPDC.ui | 389 +++++++++++++------------- iPDC/iPDC.ui~ | 640 +++++++++++++++++++++++++++++++++++++++++++ iPDC/ipdc.c | 5 + iPDC/ipdcGui.h | 1 + iPDC/utility_tools.c | 18 ++ iPDC/utility_tools.h | 2 + 7 files changed, 875 insertions(+), 187 deletions(-) create mode 100644 iPDC/iPDC.ui~ create mode 100644 iPDC/utility_tools.c create mode 100644 iPDC/utility_tools.h diff --git a/iPDC/Makefile b/iPDC/Makefile index 9f4b8e6..cddb40d 100755 --- a/iPDC/Makefile +++ b/iPDC/Makefile @@ -59,11 +59,12 @@ SOURCES = \ align_sort.c align_sort.h \ ipdcGui.c ipdcGui.h \ attack_detection.c attack_detection.h \ - data_vis.c data_vis.h + data_vis.c data_vis.h \ + utility_tools.c utility_tools.h -OBJECTS = ipdc.c recreate.o connections.o new_pmu_or_pdc.o parser.o dallocate.o align_sort.o ipdcGui.o attack_detection.o data_vis.o +OBJECTS = ipdc.c recreate.o connections.o new_pmu_or_pdc.o parser.o dallocate.o align_sort.o ipdcGui.o attack_detection.o data_vis.o utility_tools.o -CLEAN_OBJECTS = recreate.o connections.o new_pmu_or_pdc.o parser.o dallocate.o align_sort.o ipdcGui.o iPDC.xml +CLEAN_OBJECTS = recreate.o connections.o new_pmu_or_pdc.o parser.o dallocate.o align_sort.o ipdcGui.o ~iPDC.xml PROGRAM = iPDC diff --git a/iPDC/iPDC.ui b/iPDC/iPDC.ui index ba33434..42f1b74 100644 --- a/iPDC/iPDC.ui +++ b/iPDC/iPDC.ui @@ -1,122 +1,129 @@ - + True - False + False gtk-properties True - False + False gtk-go-up - 10 + 10 1 True - False + False gtk-go-down 1 True - False + False gtk-select-color 1 True - False + False gtk-close 1 True - False + False gtk-add 1 True - False + False gtk-about 1 True - False + False gtk-missing-image True - False + False gtk-quit - 10 + 10 1 True - False + False gtk-open 1 True - False + False gtk-properties 1 True - False + False gtk-new 1 True - False + False gtk-sort-ascending 1 True - False + False gtk-remove 1 True - False + False gtk-media-stop 1 - False - iPDC - A Free Phasor Data Concentrator. + 800 + 600 + False + iPDC - A Free Phasor Data Concentrator. Supportive IEEE C37.118 Synchrophasor std. iPDC - v1.3 - center-on-parent - 710 - 590 - gnome-obex-server - False + center-on-parent + 710 + 590 + gnome-obex-server + False center + + + + 800 + 600 True - False + False Add a Source Device - 240 - 35 + 284 + 35 True - True - True - PMU/PDC device from which configuration + True + True + PMU/PDC device from which configuration and data frames would be received. 0 @@ -128,12 +135,12 @@ and data frames would be received. Remove a Source Device - 240 - 35 + 284 + 35 True - True - True - Remove PMU/PDC device from which + True + True + Remove PMU/PDC device from which data frames are being received. 0 @@ -145,12 +152,12 @@ data frames are being received. Turn OFF Data Transmission - 240 - 35 + 284 + 35 True - True - True - Turn OFF data transmission of PMU/PDC device from + True + True + Turn OFF data transmission of PMU/PDC device from which data frames are being received. 0 @@ -162,12 +169,12 @@ which data frames are being received. Turn ON Data Transmission - 240 - 35 + 284 + 35 True - True - True - Turn ON data transmission of PMU/PDC device whose + True + True + Turn ON data transmission of PMU/PDC device whose data transmission is put OFF. 0 @@ -179,12 +186,12 @@ data transmission is put OFF. Request Configuration Frame - 240 - 35 + 284 + 35 True - True - True - Send Command frame to PMU/PDC device + True + True + Send Command frame to PMU/PDC device to get configuration frame. 0 @@ -196,12 +203,12 @@ to get configuration frame. Add a Destination Device - 240 - 35 + 284 + 35 True - True - True - PDC device to whom iPDC sends + True + True + PDC device to whom iPDC sends configuration and data frames. 0 @@ -213,12 +220,12 @@ configuration and data frames. Remove a Destination Device - 240 - 35 + 284 + 35 True - True - True - Remove PDC device to whom iPDC + True + True + Remove PDC device to whom iPDC sends data frames. 0 @@ -230,12 +237,12 @@ sends data frames. iPDC Connection Table - 240 - 35 + 284 + 35 True - True - True - Display source and destination devices connection tables. + True + True + Display source and destination devices connection tables. 0 @@ -246,94 +253,94 @@ sends data frames. EXIT - 100 - 35 + 0 + 0 True - True - True - Click to exit the iPDC Software. + True + True + Click to exit the iPDC Software. - 603 + 700 555 - 710 - 40 + 710 + 40 True - False - True - True - immediate + False + True + True + immediate True - False + False _File - True + True True - False + False New iPDC Setup True - False + False GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK - Click to create a new iPDC setup file. + Click to create a new iPDC setup file. image6 - False - True + False + True Open iPDC Setup True - False + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK - Click to open the saved iPDC setup file. + Click to open the saved iPDC setup file. image4 - False - True + False + True iPDC Properties True - False + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK - Click to view the iPDC setup informations. + Click to view the iPDC setup informations. image5 - False - True + False + True Connection Table True - False - Display source and destination devices connection tables. + False + Display source and destination devices connection tables. image12 - False - True + False + True Quit True - False + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK - Click to exit the iPDC Software. + Click to exit the iPDC Software. image3 - False - True + False + True @@ -343,99 +350,99 @@ sends data frames. True - False + False Edit - True + True True - False + False Add Source True - False + False GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK - PMU/PDC device from which configuration + PMU/PDC device from which configuration and data frames would be received. image7 - False - True + False + True Remove Source True - False + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK - Remove PMU/PDC device from which + Remove PMU/PDC device from which data frames are being received. image8 - False - True + False + True Data OFF True - False + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK - Turn OFF data transmission of PMU/PDC device from + Turn OFF data transmission of PMU/PDC device from which data frames are being received. image9 - False - True + False + True Data ON True - False + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK - Turn ON data transmission of PMU/PDC device whose + Turn ON data transmission of PMU/PDC device whose data transmission is put OFF. image10 - False - True + False + True Request CFG True - False - Send Command frame to PMU/PDC device + False + Send Command frame to PMU/PDC device to get configuration frame. image11 - False - True + False + True Add Destination True - False - PDC device to whom iPDC sends + False + PDC device to whom iPDC sends configuration and data frames. image14 - False - True + False + True Remove Destination True - False - Remove PDC device to whom iPDC + False + Remove PDC device to whom iPDC sends data frames. image13 - False - True + False + True @@ -445,27 +452,27 @@ sends data frames. True - False - service tools + False + service tools Tools True - False + False True - False + False Attack Detection - True + True True - False + False Data Visualization - True + True @@ -475,23 +482,23 @@ sends data frames. True - False + False _Help - True + True True - False + False About True - False + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK - Click to see the publisher, licensing, and version details. + Click to see the publisher, licensing, and version details. image15 - False - True + False + True @@ -503,102 +510,105 @@ sends data frames. Go online - 100 - 35 + 100 + 35 True - True - True - True - For more information visit the iPDC official web + True + True + True + For more information visit the iPDC official web 'ipdc.codeplex.com/'. image1 none http://ipdc.codeplex.com/ - 20 + 500 555 - 235 - 40 + 284 + 40 True - False + False 20 - 143 + 137 - 180 - 28 + 180 + 28 True - False + False True - 260 + 335 560 - 421 - 350 + 475 + 375 True False - False - iPDC - A Free Phasor Data Concentrator. + False + iPDC - A Free Phasor Data Concentrator. Supportive IEEE C37.118 Synchrophasor std. False fill - 285 - 181 + 320 + 165 - 720 - 70 + 800 + 70 True False - False + False False fill - False + False - 36 + 40 - - 800 - 20 + + Utility tools + 284 + 35 True - False + True + True + 0 - -20 - 536 + 20 + 541 - 162 - 20 + 162 + 20 True False - False - Local Time of System + False + Local Time of System right - False + False 0 0 @@ -610,7 +620,18 @@ Supportive IEEE C37.118 Synchrophasor std. 545 - 107 + 115 + + + + + 800 + 1 + True + False + + + 536 diff --git a/iPDC/iPDC.ui~ b/iPDC/iPDC.ui~ new file mode 100644 index 0000000..42f1b74 --- /dev/null +++ b/iPDC/iPDC.ui~ @@ -0,0 +1,640 @@ + + + + + + + True + False + gtk-properties + + + True + False + gtk-go-up + 10 + 1 + + + True + False + gtk-go-down + 1 + + + True + False + gtk-select-color + 1 + + + True + False + gtk-close + 1 + + + True + False + gtk-add + 1 + + + True + False + gtk-about + 1 + + + True + False + gtk-missing-image + + + True + False + gtk-quit + 10 + 1 + + + True + False + gtk-open + 1 + + + True + False + gtk-properties + 1 + + + True + False + gtk-new + 1 + + + True + False + gtk-sort-ascending + 1 + + + True + False + gtk-remove + 1 + + + True + False + gtk-media-stop + 1 + + + 800 + 600 + False + iPDC - A Free Phasor Data Concentrator. +Supportive IEEE C37.118 Synchrophasor std. + iPDC - v1.3 + center-on-parent + 710 + 590 + gnome-obex-server + False + center + + + + + + 800 + 600 + True + False + + + Add a Source Device + 284 + 35 + True + True + True + PMU/PDC device from which configuration +and data frames would be received. + 0 + + + 20 + 180 + + + + + Remove a Source Device + 284 + 35 + True + True + True + Remove PMU/PDC device from which +data frames are being received. + 0 + + + 20 + 225 + + + + + Turn OFF Data Transmission + 284 + 35 + True + True + True + Turn OFF data transmission of PMU/PDC device from +which data frames are being received. + 0 + + + 20 + 270 + + + + + Turn ON Data Transmission + 284 + 35 + True + True + True + Turn ON data transmission of PMU/PDC device whose +data transmission is put OFF. + 0 + + + 20 + 315 + + + + + Request Configuration Frame + 284 + 35 + True + True + True + Send Command frame to PMU/PDC device +to get configuration frame. + 0 + + + 20 + 360 + + + + + Add a Destination Device + 284 + 35 + True + True + True + PDC device to whom iPDC sends +configuration and data frames. + 0 + + + 20 + 405 + + + + + Remove a Destination Device + 284 + 35 + True + True + True + Remove PDC device to whom iPDC +sends data frames. + 0 + + + 20 + 449 + + + + + iPDC Connection Table + 284 + 35 + True + True + True + Display source and destination devices connection tables. + 0 + + + 20 + 495 + + + + + EXIT + 0 + 0 + True + True + True + Click to exit the iPDC Software. + + + 700 + 555 + + + + + 710 + 40 + True + False + True + True + immediate + + + True + False + _File + True + + + True + False + + + New iPDC Setup + True + False + GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK + Click to create a new iPDC setup file. + image6 + False + True + + + + + Open iPDC Setup + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK + Click to open the saved iPDC setup file. + image4 + False + True + + + + + iPDC Properties + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK + Click to view the iPDC setup informations. + image5 + False + True + + + + + Connection Table + True + False + Display source and destination devices connection tables. + image12 + False + True + + + + + Quit + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK + Click to exit the iPDC Software. + image3 + False + True + + + + + + + + + True + False + Edit + True + + + True + False + + + Add Source + True + False + GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK + PMU/PDC device from which configuration +and data frames would be received. + image7 + False + True + + + + + Remove Source + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK + Remove PMU/PDC device from which +data frames are being received. + image8 + False + True + + + + + Data OFF + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK + Turn OFF data transmission of PMU/PDC device from +which data frames are being received. + image9 + False + True + + + + + Data ON + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK + Turn ON data transmission of PMU/PDC device whose +data transmission is put OFF. + image10 + False + True + + + + + Request CFG + True + False + Send Command frame to PMU/PDC device +to get configuration frame. + image11 + False + True + + + + + Add Destination + True + False + PDC device to whom iPDC sends +configuration and data frames. + image14 + False + True + + + + + Remove Destination + True + False + Remove PDC device to whom iPDC +sends data frames. + image13 + False + True + + + + + + + + + True + False + service tools + Tools + + + True + False + + + True + False + Attack Detection + True + + + + + True + False + Data Visualization + True + + + + + + + + + True + False + _Help + True + + + True + False + + + About + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_KEY_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_STRUCTURE_MASK + Click to see the publisher, licensing, and version details. + image15 + False + True + + + + + + + + + + + Go online + 100 + 35 + True + True + True + True + For more information visit the iPDC official web +'ipdc.codeplex.com/'. + image1 + none + http://ipdc.codeplex.com/ + + + 500 + 555 + + + + + 284 + 40 + True + False + + + 20 + 137 + + + + + 180 + 28 + True + False + True + + + 335 + 560 + + + + + 475 + 375 + True + False + False + iPDC - A Free Phasor Data Concentrator. +Supportive IEEE C37.118 Synchrophasor std. + False + fill + + + 320 + 165 + + + + + 800 + 70 + True + False + False + False + fill + False + + + 40 + + + + + Utility tools + 284 + 35 + True + True + True + 0 + + + 20 + 541 + + + + + 162 + 20 + True + False + False + Local Time of System + right + False + 0 + 0 + + + + + + + + + 545 + 115 + + + + + 800 + 1 + True + False + + + 536 + + + + + + diff --git a/iPDC/ipdc.c b/iPDC/ipdc.c index 044e583..a814ea3 100755 --- a/iPDC/ipdc.c +++ b/iPDC/ipdc.c @@ -47,6 +47,7 @@ #include "ipdcGui.h" #include "attack_detection.h" #include "data_vis.h" +#include "utility_tools.h" /* Common fixed path for storage of few common files */ #define UI_fILE "./iPDC.ui" @@ -123,6 +124,7 @@ int main(int argc, char **argv) GW(menuitem3); GW(attack_detection); GW(data_vis); + GW(utility_tools); #undef GW /* Connect signals */ @@ -147,6 +149,7 @@ int main(int argc, char **argv) gtk_widget_set_sensitive(GTK_WIDGET(data->add_pdc_button), FALSE); gtk_widget_set_sensitive(GTK_WIDGET(data->remove_pdc_button), FALSE); gtk_widget_set_sensitive(GTK_WIDGET(data->display_conn_table_button), FALSE); + //gtk_widget_set_sensitive(GTK_WIDGET(data->utility_tools), FALSE); // gtk_widget_set_visible(GTK_WIDGET(data->menuitem2), TRUE); gtk_widget_set_visible(GTK_WIDGET(data->menu_conn_table), FALSE); @@ -258,6 +261,7 @@ int main(int argc, char **argv) /* Signals Definitions*/ g_signal_connect (data->add_pmu_button, "clicked", G_CALLBACK(add_pmu), NULL); g_signal_connect (data->menu_add_source, "activate", G_CALLBACK(add_pmu), NULL); + g_signal_connect(data->utility_tools, "activate", G_CALLBACK(utility_tools), NULL); g_signal_connect (data->remove_pmu_button, "clicked", G_CALLBACK(cmd_or_remove_pmu), (gpointer) "1"); g_signal_connect (data->menu_remove_source, "activate", G_CALLBACK(cmd_or_remove_pmu), (gpointer) "1"); @@ -290,6 +294,7 @@ int main(int argc, char **argv) g_signal_connect(data->attack_detection,"activate",G_CALLBACK(attack_detection_window),NULL); g_signal_connect(data->data_vis, "activate", G_CALLBACK(data_vis_window), NULL); + /* Destroy builder, since we don't need it anymore */ g_object_unref(G_OBJECT(builder)); diff --git a/iPDC/ipdcGui.h b/iPDC/ipdcGui.h index a1f422c..f489e44 100755 --- a/iPDC/ipdcGui.h +++ b/iPDC/ipdcGui.h @@ -60,6 +60,7 @@ struct _ChData GtkWidget *add_pdc_button; GtkWidget *remove_pdc_button; GtkWidget *display_conn_table_button; + GtkWidget *utility_tools; GtkWidget *exit_button; /* Manubar button widgets */ diff --git a/iPDC/utility_tools.c b/iPDC/utility_tools.c new file mode 100644 index 0000000..9eb91b0 --- /dev/null +++ b/iPDC/utility_tools.c @@ -0,0 +1,18 @@ +#include +#include + +void utility_tools() +{ + GtkWidget *new_window; + new_window = gtk_dialog_new(); + + //gtk_window_fullscreen(GTK_WINDOW(new_window)); + // gtk_window_set_default_size(GTK_WINDOW(new_window), 800, 600); + // gtk_window_set_resizable(GTK_WINDOW(new_window), FALSE); + // gtk_window_set_position(GTK_WINDOW(new_window), GTK_WIN_POS_CENTER); + + // /* Set the Title of Main Window */ + // gtk_window_set_title (GTK_WINDOW (new_window), "iPDC utility tools"); + // g_signal_connect (new_window, "destroy", G_CALLBACK(gtk_widget_destroy), new_window); + gtk_widget_show(new_window); +} \ No newline at end of file diff --git a/iPDC/utility_tools.h b/iPDC/utility_tools.h new file mode 100644 index 0000000..76f8c1d --- /dev/null +++ b/iPDC/utility_tools.h @@ -0,0 +1,2 @@ +#include +void utility_tools(); \ No newline at end of file