Basic model of line chart
This commit is contained in:
parent
c4b2a05020
commit
5886069a3d
|
@ -46,7 +46,7 @@ FILE6 = iPDC.desktop
|
|||
|
||||
CC = gcc
|
||||
LIBS = -lpthread
|
||||
LDLIBS=`pkg-config --cflags --libs gtk+-3.0 osmgpsmap-1.0 gee-0.8`
|
||||
LDLIBS=`pkg-config --cflags --libs gtk+-3.0 osmgpsmap-1.0 gee-0.8` lib/liblivechart.so lib/liblivechart_static.a -Wl,--rpath=./lib
|
||||
CFLAGS=-g -I./inc -I./lib -fcommon `pkg-config --cflags --libs gtk+-3.0 osmgpsmap-1.0 gee-0.8`
|
||||
|
||||
PROGRAM = iPDC
|
||||
|
@ -57,7 +57,7 @@ CLEAN_OBJECTS = $(wildcard bin/*.o) $(PROGRAM)
|
|||
all: $(PROGRAM)
|
||||
|
||||
$(PROGRAM): $(OBJECT_FILES)
|
||||
$(CC) $(CFLAGS) $(OBJECT_FILES) -o $(PROGRAM) $(LDLIBS)
|
||||
$(CC) $(CFLAGS) $(OBJECT_FILES) -o $(PROGRAM) $(LDLIBS)
|
||||
|
||||
bin/%.o: src/%.c
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<requires lib="gtk+" version="3.24"/>
|
||||
<object class="GtkWindow" id="util_window">
|
||||
<property name="width-request">800</property>
|
||||
<property name="height-request">600</property>
|
||||
<property name="height-request">700</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkLayout" id="util_layout">
|
||||
|
@ -169,7 +169,7 @@
|
|||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<!-- n-columns=3 n-rows=3 -->
|
||||
<!-- n-columns=2 n-rows=2 -->
|
||||
<object class="GtkGrid">
|
||||
<property name="width-request">100</property>
|
||||
<property name="height-request">80</property>
|
||||
|
@ -271,22 +271,15 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
<object class="GtkLayout" id="graph_layout">
|
||||
<property name="height-request">150</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
|
|
|
@ -0,0 +1,302 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.38.2 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.24"/>
|
||||
<object class="GtkWindow" id="util_window">
|
||||
<property name="width-request">800</property>
|
||||
<property name="height-request">600</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkLayout" id="util_layout">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-left">10</property>
|
||||
<property name="margin-right">10</property>
|
||||
<property name="margin-bottom">3</property>
|
||||
<child>
|
||||
<object class="GtkMenuBar" id="util_menubar">
|
||||
<property name="width-request">800</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="can-default">True</property>
|
||||
<property name="resize-mode">immediate</property>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">_File</property>
|
||||
<property name="use-underline">True</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem">
|
||||
<property name="label">gtk-new</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="use-stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem">
|
||||
<property name="label">gtk-open</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="use-stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem">
|
||||
<property name="label">gtk-save</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="use-stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem">
|
||||
<property name="label">gtk-save-as</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="use-stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem">
|
||||
<property name="label">gtk-quit</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="use-stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">_Edit</property>
|
||||
<property name="use-underline">True</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem">
|
||||
<property name="label">gtk-cut</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="use-stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem">
|
||||
<property name="label">gtk-copy</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="use-stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem">
|
||||
<property name="label">gtk-paste</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="use-stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem">
|
||||
<property name="label">gtk-delete</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="use-stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">_View</property>
|
||||
<property name="use-underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes">_Help</property>
|
||||
<property name="use-underline">True</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem">
|
||||
<property name="label">gtk-about</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="use-stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<!-- n-columns=3 n-rows=3 -->
|
||||
<object class="GtkGrid">
|
||||
<property name="width-request">100</property>
|
||||
<property name="height-request">80</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="app-paintable">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="column-spacing">6</property>
|
||||
<child>
|
||||
<!-- n-columns=1 n-rows=5 -->
|
||||
<object class="GtkGrid">
|
||||
<property name="width-request">80</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="row-spacing">35</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="voltage">
|
||||
<property name="label" translatable="yes">Voltage</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="freq">
|
||||
<property name="label" translatable="yes">Frequency</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="attack_detection">
|
||||
<property name="label" translatable="yes">Attack Detection</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="algorithm">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="active">0</property>
|
||||
<items>
|
||||
<item id="0" translatable="yes">kmeans</item>
|
||||
<item id="1" translatable="yes">simple</item>
|
||||
</items>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="dimmension">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="active">0</property>
|
||||
<items>
|
||||
<item id="0" translatable="yes">frequency only</item>
|
||||
<item id="1" translatable="yes">frequency,voltage</item>
|
||||
<item id="2" translatable="yes">voltage</item>
|
||||
</items>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLayout" id="map_layout">
|
||||
<property name="width-request">600</property>
|
||||
<property name="height-request">500</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="y">30</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
|
@ -9,5 +9,4 @@ typedef struct{
|
|||
} myParameters;
|
||||
|
||||
|
||||
|
||||
gboolean update_images(gpointer* pars);
|
|
@ -1,6 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include<gtk/gtk.h>
|
||||
#include "osm-gps-map.h"
|
||||
#include "livechart.h"
|
||||
|
||||
/* Convenience macros for obtaining objects from UI file */
|
||||
#define CH_GET_OBJECT(builder, name, type, data) \
|
||||
|
@ -24,14 +25,11 @@ struct _UtData
|
|||
GtkWidget *dimmension;
|
||||
OsmGpsMap *util_map;
|
||||
GtkContainer *map_layout;
|
||||
GtkContainer *graph_layout;
|
||||
};
|
||||
|
||||
UtData *utdata;
|
||||
|
||||
/* UI variables */
|
||||
int curr_measurement = 0;
|
||||
int algorithm =0;
|
||||
int dimmensions = 0;
|
||||
LiveChartSerie *serie;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -6,13 +6,19 @@
|
|||
#include "Attack_detect.h"
|
||||
#include "connections.h"
|
||||
#include "livechart.h"
|
||||
// #include "utility_tools.h"
|
||||
#include "utility_tools.h"
|
||||
|
||||
extern int curr_measurement;
|
||||
extern int algorithm;
|
||||
extern int dimmensions;
|
||||
|
||||
// debug
|
||||
int loops = 0;
|
||||
|
||||
gboolean update_images(gpointer* pars){
|
||||
int match=0,id;
|
||||
myParameters* parameters = (myParameters*) pars;
|
||||
struct data_frame *df = TSB[0].first_data_frame;
|
||||
struct data_frame *df = TSB[4].first_data_frame;
|
||||
struct Lower_Layer_Details *LLptr;
|
||||
|
||||
if (df == NULL){
|
||||
|
@ -20,36 +26,38 @@ gboolean update_images(gpointer* pars){
|
|||
}
|
||||
// if (curr_measurement==1)
|
||||
// {
|
||||
while (df != NULL){
|
||||
id = to_intconvertor(df->idcode);
|
||||
printf("id = %d\n",id);
|
||||
int freq = to_intconvertor(df->dpmu[0]->freq)-200;
|
||||
live_chart_serie_add(serie, freq);
|
||||
loops++;
|
||||
printf("loops: %d\n", loops);
|
||||
// id = to_intconvertor(df->idcode);
|
||||
// printf("id = %d\n",id);
|
||||
|
||||
LLptr = LLfirst;
|
||||
// LLptr = LLfirst;
|
||||
|
||||
while(LLptr != NULL){
|
||||
printf("pmuid = %d\n",LLptr->pmuid);
|
||||
if(LLptr->pmuid == id){
|
||||
match = 1;
|
||||
break;
|
||||
}
|
||||
LLptr = LLptr->next;
|
||||
}
|
||||
// while(LLptr != NULL){
|
||||
// printf("pmuid = %d\n",LLptr->pmuid);
|
||||
// if(LLptr->pmuid == id){
|
||||
// match = 1;
|
||||
// break;
|
||||
// }
|
||||
// LLptr = LLptr->next;
|
||||
// }
|
||||
|
||||
if(match == 1){
|
||||
float lat = LLptr->latitude;
|
||||
float lon = LLptr->longitude;
|
||||
float freq = to_intconvertor(df->dpmu[0]->freq)*0.001+50;
|
||||
printf("lat = %f, lon = %f, freq = %f\n",lat,lon,freq);
|
||||
// if(match == 1){
|
||||
float lat = 79.347312;
|
||||
float lon = -69.439209;
|
||||
// float freq = to_intconvertor(df->dpmu[0]->freq)*0.001+50;
|
||||
printf("lat = %f, lon = %f, freq = %d\n",lat,lon,freq);
|
||||
// gboolean green =attack_detect(df,&START,&COUNT,&SUM_OF_FREQUENCY);
|
||||
|
||||
if(parameters->g_last_image != 0){
|
||||
osm_gps_map_image_remove(parameters->util_map, parameters->g_last_image);
|
||||
}
|
||||
if (freq > 50.300){
|
||||
parameters->g_last_image = osm_gps_map_image_add(parameters->util_map,lat, lon, parameters->g_green_image);
|
||||
}else{
|
||||
parameters->g_last_image = osm_gps_map_image_add(parameters->util_map,lat, lon, parameters->g_red_image);
|
||||
}
|
||||
// if(parameters->g_last_image != 0){
|
||||
// osm_gps_map_image_remove(parameters->util_map, parameters->g_last_image);
|
||||
// }
|
||||
// if (freq > 50.300){
|
||||
// parameters->g_last_image = osm_gps_map_image_add(parameters->util_map,lat, lon, parameters->g_green_image);
|
||||
// }else{
|
||||
// parameters->g_last_image = osm_gps_map_image_add(parameters->util_map,lat, lon, parameters->g_red_image);
|
||||
// }
|
||||
// if(parameters->g_last_image != 0){
|
||||
// osm_gps_map_image_remove(parameters->util_map, parameters->g_last_image);
|
||||
// }
|
||||
|
@ -58,15 +66,10 @@ gboolean update_images(gpointer* pars){
|
|||
// }else{
|
||||
// parameters->g_last_image = osm_gps_map_image_add(parameters->util_map,15.518597, 74.925584, parameters->g_red_image);
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
df = df->dnext;
|
||||
}
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
gtk_widget_queue_draw(GTK_WIDGET(parameters->util_map));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
#include<gtk/gtk.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "align_sort.h"
|
||||
#include "parser.h"
|
||||
#include "osm-gps-map.h"
|
||||
#include "map_vis.h"
|
||||
#include "utility_tools.h"
|
||||
#include "livechart.h"
|
||||
|
||||
#define UI_fILE "./assets/utility_tools.ui"
|
||||
#define RED_IMAGE "./assets/red.png"
|
||||
#define GREEN_IMAGE "./assets/green.png"
|
||||
|
||||
|
||||
int curr_measurement = 0;
|
||||
int algorithm =0;
|
||||
int dimmensions = 0;
|
||||
|
||||
// void change_image(OsmGpsMap *map, float lat, float lon, OsmGpsMapImage *image)
|
||||
// {
|
||||
|
@ -35,7 +38,6 @@ void on_frequency_clicked(GtkButton *but, gpointer udata)
|
|||
gtk_widget_set_sensitive(utdata->frequency, FALSE);
|
||||
gtk_widget_set_sensitive(utdata->attack_detection, TRUE);
|
||||
|
||||
|
||||
// printf("Frequency\n");
|
||||
}
|
||||
|
||||
|
@ -71,16 +73,14 @@ void utility_tools(GtkButton *but, gpointer udata)
|
|||
OsmGpsMapImage *g_last_image;
|
||||
// -------------------
|
||||
GtkBuilder *builder;
|
||||
GError *error = NULL;
|
||||
GError *error = NULL;
|
||||
builder = gtk_builder_new();
|
||||
|
||||
|
||||
|
||||
if(!gtk_builder_add_from_file(builder, UI_fILE, &error))
|
||||
{
|
||||
g_warning("%s", error->message);
|
||||
g_free(error);
|
||||
}
|
||||
if (!gtk_builder_add_from_file(builder, UI_fILE, &error))
|
||||
{
|
||||
g_warning("%s", error->message);
|
||||
g_free(error);
|
||||
}
|
||||
|
||||
utdata = g_slice_new(UtData);
|
||||
utdata->util_window = GTK_WIDGET(gtk_builder_get_object(builder, "util_window"));
|
||||
|
@ -91,7 +91,8 @@ void utility_tools(GtkButton *but, gpointer udata)
|
|||
utdata->dimmension = GTK_WIDGET(gtk_builder_get_object(builder, "dimmension"));
|
||||
// utdata->util_map = GTK_WIDGET(gtk_builder_get_object(builder, "util_map"));
|
||||
utdata->map_layout = GTK_CONTAINER(gtk_builder_get_object(builder, "map_layout"));
|
||||
|
||||
utdata->graph_layout = GTK_CONTAINER(gtk_builder_get_object(builder, "graph_layout"));
|
||||
|
||||
gtk_widget_set_sensitive(utdata->voltage, FALSE);
|
||||
gtk_widget_set_visible(utdata->algorithm, FALSE);
|
||||
gtk_widget_set_visible(utdata->dimmension, FALSE);
|
||||
|
@ -100,35 +101,60 @@ void utility_tools(GtkButton *but, gpointer udata)
|
|||
g_signal_connect(utdata->frequency, "clicked", G_CALLBACK(on_frequency_clicked), NULL);
|
||||
g_signal_connect(utdata->voltage, "clicked", G_CALLBACK(on_voltage_clicked), NULL);
|
||||
|
||||
g_red_image = gdk_pixbuf_new_from_file_at_size(RED_IMAGE, 24, 24, NULL);
|
||||
g_green_image = gdk_pixbuf_new_from_file_at_size(GREEN_IMAGE, 24, 24, NULL);
|
||||
|
||||
|
||||
|
||||
g_red_image = gdk_pixbuf_new_from_file_at_size (RED_IMAGE, 24,24,NULL);
|
||||
g_green_image = gdk_pixbuf_new_from_file_at_size (GREEN_IMAGE, 24,24,NULL);
|
||||
|
||||
|
||||
|
||||
utdata->util_map = g_object_new (OSM_TYPE_GPS_MAP,
|
||||
"map-source", OSM_GPS_MAP_SOURCE_OPENSTREETMAP,
|
||||
"tile-cache", "/tmp/",
|
||||
NULL);
|
||||
osm_gps_map_set_center_and_zoom (utdata->util_map, 15.4589, 75.0078, 10);
|
||||
utdata->util_map = g_object_new(OSM_TYPE_GPS_MAP,
|
||||
"map-source", OSM_GPS_MAP_SOURCE_OSMC_TRAILS,
|
||||
"tile-cache", "/tmp/",
|
||||
NULL);
|
||||
osm_gps_map_set_center_and_zoom(utdata->util_map, 15.4589, 75.0078, 10);
|
||||
|
||||
// TODO: add the points to window.
|
||||
g_last_image = osm_gps_map_image_add(utdata->util_map,15.4589, 75.0078, g_red_image);
|
||||
g_last_image = osm_gps_map_image_add(utdata->util_map,15.518597, 74.925584, g_green_image);
|
||||
|
||||
|
||||
g_last_image = osm_gps_map_image_add(utdata->util_map, 15.4589, 75.0078, g_red_image);
|
||||
g_last_image = osm_gps_map_image_add(utdata->util_map, 15.518597, 74.925584, g_green_image);
|
||||
|
||||
myParameters parameters = {utdata->util_map, g_red_image, g_green_image, g_last_image};
|
||||
gpointer data = (gpointer) ¶meters;
|
||||
guint pid = g_timeout_add(20, (GSourceFunc) update_images, data);
|
||||
gpointer data = (gpointer)¶meters;
|
||||
guint pid = g_timeout_add(20, (GSourceFunc)update_images, data);
|
||||
|
||||
gtk_widget_set_size_request(GTK_WIDGET(utdata->util_map), 600, 500);
|
||||
|
||||
gtk_container_add(utdata->map_layout, GTK_WIDGET(utdata->util_map));
|
||||
|
||||
// add live chart
|
||||
serie = live_chart_serie_new("Hello", (LiveChartSerieRenderer*)live_chart_line_new (live_chart_values_new(10000)));
|
||||
// live_chart set color to the serie
|
||||
GdkRGBA color;
|
||||
color.red = 1.0;
|
||||
color.green = 0.0;
|
||||
color.blue = 1.0;
|
||||
color.alpha = 1.0;
|
||||
|
||||
live_chart_path_set_color(live_chart_serie_get_line(serie), &color);
|
||||
LiveChartConfig *config = live_chart_config_new();
|
||||
live_chart_yaxis_set_unit(config->y_axis, "mHz");
|
||||
live_chart_xaxis_set_tick_interval(config->x_axis, 20);
|
||||
live_chart_xaxis_set_tick_length(config->x_axis, 100);
|
||||
live_chart_yaxis_update_bounds(config->y_axis, 1);
|
||||
live_chart_path_set_visible(config->x_axis->lines, FALSE);
|
||||
|
||||
LiveChartChart *chart = live_chart_chart_new(config);
|
||||
live_chart_chart_add_serie(chart, serie);
|
||||
|
||||
// gtk_widget_set_hexpand(GTK_WIDGET(chart), TRUE);
|
||||
// gtk_widget_set_vexpand(GTK_WIDGET(chart), TRUE);
|
||||
gtk_widget_set_size_request(GTK_WIDGET(chart), 600, 150);
|
||||
|
||||
gtk_container_add(utdata->graph_layout, GTK_WIDGET(chart));
|
||||
|
||||
|
||||
|
||||
|
||||
g_signal_connect(utdata->util_window, "destroy", G_CALLBACK(on_window_destroy), GUINT_TO_POINTER(pid));
|
||||
|
||||
// gtk_widget_set_vexpand(GTK_WIDGET(utdata->util_map), TRUE);
|
||||
// gtk_widget_set_hexpand(GTK_WIDGET(utdata->util_map), TRUE);
|
||||
gtk_widget_show_all(utdata->util_window);
|
||||
|
||||
gtk_widget_hide(utdata->algorithm);
|
||||
|
|
Loading…
Reference in New Issue