2022-11-18 13:00:12 +05:30
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* utility_tools.h
|
|
|
|
*
|
|
|
|
* iPDC - Phasor Data Concentrator
|
|
|
|
*
|
|
|
|
* Copyright (C) 2022-2023 Nitesh Pandit
|
|
|
|
* Copyright (C) 2022-2023 Kedar V. Khandeparkar
|
2022-11-18 15:10:42 +05:30
|
|
|
* Copyright (C) 2022-2023 Pavan Kumar V Patil
|
|
|
|
* Copyright (C) 2022-2023 Karthik Murakonda
|
2022-11-18 13:00:12 +05:30
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* Authors:
|
2022-11-18 14:22:20 +05:30
|
|
|
* M V Karthik <karthik.murakonda14@gmail.com>
|
2022-11-18 13:00:12 +05:30
|
|
|
* Pavan Kumar V Patil <pavanvpatil01@gmail.com>
|
|
|
|
*
|
|
|
|
* ----------------------------------------------------------------------------- */
|
|
|
|
|
2022-09-28 16:40:10 +05:30
|
|
|
#include <stdio.h>
|
2022-11-18 13:00:12 +05:30
|
|
|
#include <gtk/gtk.h>
|
2022-09-24 14:25:37 +05:30
|
|
|
#include "osm-gps-map.h"
|
2022-10-20 14:26:58 +05:30
|
|
|
#include "livechart.h"
|
2022-08-23 22:04:29 +05:30
|
|
|
|
|
|
|
/* Convenience macros for obtaining objects from UI file */
|
|
|
|
#define CH_GET_OBJECT(builder, name, type, data) \
|
2022-11-18 13:00:12 +05:30
|
|
|
data->name = type(gtk_builder_get_object(builder, #name))
|
2022-08-23 22:04:29 +05:30
|
|
|
#define CH_GET_WIDGET(builder, name, data) \
|
2022-11-18 13:00:12 +05:30
|
|
|
CH_GET_OBJECT(builder, name, GTK_WIDGET, data)
|
2022-08-23 22:04:29 +05:30
|
|
|
|
2022-10-19 16:30:42 +05:30
|
|
|
/* Main data structure definition */
|
|
|
|
typedef struct _UtData UtData;
|
|
|
|
|
|
|
|
struct _UtData
|
|
|
|
{
|
|
|
|
/* Main window */
|
2022-11-18 13:00:12 +05:30
|
|
|
GtkWidget *util_window;
|
2022-10-19 16:30:42 +05:30
|
|
|
|
|
|
|
/* ui buttons */
|
|
|
|
GtkWidget *voltage;
|
|
|
|
GtkWidget *frequency;
|
2022-10-29 15:58:45 +05:30
|
|
|
GtkWidget *dfreq;
|
2022-10-19 16:30:42 +05:30
|
|
|
GtkWidget *attack_detection;
|
|
|
|
GtkWidget *algorithm;
|
|
|
|
GtkWidget *dimmension;
|
|
|
|
OsmGpsMap *util_map;
|
|
|
|
GtkContainer *map_layout;
|
2022-10-29 15:58:45 +05:30
|
|
|
GtkContainer *graph_layoutvol;
|
|
|
|
GtkContainer *graph_layoutfreq;
|
|
|
|
GtkContainer *graph_layoutdfreq;
|
|
|
|
GtkLabel *algo_label;
|
|
|
|
GtkLabel *dimm_label;
|
2022-11-18 13:00:12 +05:30
|
|
|
GtkBox *ml_vol;
|
|
|
|
GtkBox *ml_freq;
|
|
|
|
GtkBox *ml_dfreq;
|
|
|
|
GtkBox *ml_ad;
|
2022-10-29 15:58:45 +05:30
|
|
|
GtkWidget *swvol;
|
|
|
|
GtkWidget *swfreq;
|
|
|
|
GtkWidget *swdfreq;
|
|
|
|
GtkWidget *swad;
|
2022-10-29 23:53:32 +05:30
|
|
|
GtkWidget *maplabel;
|
|
|
|
GtkWidget *graphlabel;
|
2022-11-10 11:21:36 +05:30
|
|
|
GtkWidget *gl1;
|
|
|
|
GtkWidget *gl2;
|
|
|
|
GtkWidget *gl3;
|
2022-10-19 16:30:42 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
UtData *utdata;
|
|
|
|
|
2022-10-25 21:43:07 +05:30
|
|
|
// global variables
|
|
|
|
int curr_measurement;
|
|
|
|
int algorithm;
|
|
|
|
int dimmension;
|
|
|
|
|
2022-08-23 13:05:44 +05:30
|
|
|
void utility_tools(GtkButton *but, gpointer udata);
|