added sample dialog for data_visualization

This commit is contained in:
karthikmv 2022-08-11 15:52:28 +05:30
parent f959d00e6a
commit 58ea2e30a2
4 changed files with 31 additions and 4 deletions

View File

@ -58,9 +58,10 @@ SOURCES = \
dallocate.c dallocate.h \
align_sort.c align_sort.h \
ipdcGui.c ipdcGui.h \
attack_detection.c attack_detection.h
attack_detection.c attack_detection.h \
data_vis.c data_vis.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
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
CLEAN_OBJECTS = recreate.o connections.o new_pmu_or_pdc.o parser.o dallocate.o align_sort.o ipdcGui.o iPDC.xml

19
iPDC/data_vis.c Normal file
View File

@ -0,0 +1,19 @@
#include<gtk/gtk.h>
#include<stdio.h>
void data_vis_window(GtkButton *widget,gpointer udata)
{
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);
//gtk_window_set_icon(GTK_WINDOW(new_window), create_pixbuf("/usr/local/share/iPDC/logo.png"));
/* Set the Title of Main Window */
gtk_window_set_title (GTK_WINDOW (new_window), "iPDC");
g_signal_connect (new_window, "destroy", G_CALLBACK(gtk_widget_destroy), new_window);
gtk_widget_show(new_window);
}

3
iPDC/data_vis.h Normal file
View File

@ -0,0 +1,3 @@
#include<gtk/gtk.h>
void data_vis_window(GtkButton *widget,gpointer udata);

View File

@ -46,9 +46,10 @@
#include "global.h"
#include "ipdcGui.h"
#include "attack_detection.h"
#include "data_vis.h"
/* Common fixed path for storage of few common files */
#define UI_fILE "/home/pavan/Desktop/iPDC-suite/iPDC/iPDC.ui"
#define UI_fILE "./iPDC.ui"
/* ---------------------------------------------------------------- */
@ -260,7 +261,7 @@ int main(int argc, char **argv)
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");
g_signal_connect(data->attack_detection,"activate",G_CALLBACK(attack_detection_window),NULL);
g_signal_connect (data->cmd_data_off_button, "clicked", G_CALLBACK(cmd_or_remove_pmu), (gpointer) "2");
g_signal_connect (data->menu_data_off, "activate", G_CALLBACK(cmd_or_remove_pmu), (gpointer) "2");
@ -287,6 +288,9 @@ int main(int argc, char **argv)
g_signal_connect (data->about_menuitem, "activate", G_CALLBACK(about_ipdc), NULL);
g_signal_connect (data->ipdc, "destroy", G_CALLBACK(destroy), NULL);
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));