Commit 3ba801ae authored by Claes Sjofors's avatar Claes Sjofors

Xtt commands 'wait' and 'close graph/classgraph' added

parent 49e52a1d
...@@ -54,6 +54,6 @@ queuefull <Queue is full> /error ...@@ -54,6 +54,6 @@ queuefull <Queue is full> /error
waveformat <Unsupported wavefile format> /error waveformat <Unsupported wavefile format> /error
filecorrupt <File is corrupt> /error filecorrupt <File is corrupt> /error
notcollectw <Not collect window> /error notcollectw <Not collect window> /error
noclassgraph <No classgraph found> /error
...@@ -165,4 +165,6 @@ ...@@ -165,4 +165,6 @@
100201 cs xtt Commands 'open graph /class/parent' and 'check isattribute' added button in object graphs to open parent object graph. 100201 cs xtt Commands 'open graph /class/parent' and 'check isattribute' added button in object graphs to open parent object graph.
100209 cs xtt Error message for invalid local attributes in Ge graphs. 100209 cs xtt Error message for invalid local attributes in Ge graphs.
100209 cs ge Command 'set attr/bypass' replaced by action SetValue in object graphs. 100209 cs ge Command 'set attr/bypass' replaced by action SetValue in object graphs.
100209 cs ge PID object graph, indicator for Inverse didn't work. 100209 cs ge PID object graph, indicator for Inverse didn't work.
\ No newline at end of file 100216 cs xtt Command 'close graph', qualifier /classgraph added.
100216 cs xtt Command 'wait' added.
\ No newline at end of file
...@@ -44,6 +44,13 @@ typedef struct { ...@@ -44,6 +44,13 @@ typedef struct {
} wow_sSelection; } wow_sSelection;
CoWowGtk::~CoWowGtk()
{
if ( m_wait_timerid)
g_source_remove( m_wait_timerid);
}
void CoWowGtk::question_ok_cb( GtkWidget *w, gpointer data) void CoWowGtk::question_ok_cb( GtkWidget *w, gpointer data)
{ {
wow_t_question_cb *cbdata = (wow_t_question_cb *) data; wow_t_question_cb *cbdata = (wow_t_question_cb *) data;
...@@ -735,6 +742,7 @@ CoWowTimerGtk::~CoWowTimerGtk() ...@@ -735,6 +742,7 @@ CoWowTimerGtk::~CoWowTimerGtk()
{ {
if ( m_timerid) if ( m_timerid)
g_source_remove( m_timerid); g_source_remove( m_timerid);
} }
void CoWowTimerGtk::add( int time, void (* callback)(void *data), void *data) void CoWowTimerGtk::add( int time, void (* callback)(void *data), void *data)
...@@ -1315,6 +1323,23 @@ pwr_tStatus CoWowGtk::DeleteMenuItem( const char *name, void *menu) ...@@ -1315,6 +1323,23 @@ pwr_tStatus CoWowGtk::DeleteMenuItem( const char *name, void *menu)
} }
gboolean CoWowGtk::wait_cb( void *data)
{
((CoWowGtk *)data)->m_wait_timerid = 0;
gtk_main_quit();
return FALSE;
}
void CoWowGtk::Wait( float time)
{
m_wait_timerid = g_timeout_add( int(time * 1000), wait_cb, this);
gtk_main();
}
......
...@@ -87,9 +87,10 @@ class CoWowTimerGtk : public CoWowTimer { ...@@ -87,9 +87,10 @@ class CoWowTimerGtk : public CoWowTimer {
class CoWowGtk : public CoWow { class CoWowGtk : public CoWow {
public: public:
GtkWidget *m_parent; GtkWidget *m_parent;
gint m_wait_timerid;
CoWowGtk( GtkWidget *parent) : m_parent(parent) {} CoWowGtk( GtkWidget *parent) : m_parent(parent), m_wait_timerid(0) {}
~CoWowGtk() {} ~CoWowGtk();
void DisplayQuestion( void *ctx, const char *title, const char *text, void DisplayQuestion( void *ctx, const char *title, const char *text,
void (* questionbox_ok) ( void *, void *), void (* questionbox_ok) ( void *, void *),
void (* questionbox_cancel) ( void *, void *), void (* questionbox_cancel) ( void *, void *),
...@@ -116,6 +117,7 @@ class CoWowGtk : public CoWow { ...@@ -116,6 +117,7 @@ class CoWowGtk : public CoWow {
pwr_tStatus DeleteMenuItem( const char *name, void *menu); pwr_tStatus DeleteMenuItem( const char *name, void *menu);
CoWowTimer *timer_new(); CoWowTimer *timer_new();
void SetParent( GtkWidget *parent) { m_parent = parent;} void SetParent( GtkWidget *parent) { m_parent = parent;}
void Wait( float time);
static void PopupPosition( GtkWidget *parent, int x_event, int y_event, int *x, int *y); static void PopupPosition( GtkWidget *parent, int x_event, int y_event, int *x, int *y);
static void GetAtoms( GdkAtom *graph_atom, GdkAtom *objid_atom, GdkAtom *attrref_atom); static void GetAtoms( GdkAtom *graph_atom, GdkAtom *objid_atom, GdkAtom *attrref_atom);
...@@ -140,6 +142,8 @@ class CoWowGtk : public CoWow { ...@@ -140,6 +142,8 @@ class CoWowGtk : public CoWow {
static void list_apply_cb( GtkWidget *w, gpointer data); static void list_apply_cb( GtkWidget *w, gpointer data);
static void list_ok_cb( GtkWidget *w, gpointer data); static void list_ok_cb( GtkWidget *w, gpointer data);
static void list_cancel_cb( GtkWidget *w, gpointer data); static void list_cancel_cb( GtkWidget *w, gpointer data);
static gboolean wait_cb( void *data);
}; };
#endif #endif
......
...@@ -106,13 +106,14 @@ class CoWow { ...@@ -106,13 +106,14 @@ class CoWow {
const char *button1, const char *button2, const char *button1, const char *button2,
const char *button3, const char *image, const char *button3, const char *image,
int input_length) { return 0;} int input_length) { return 0;}
virtual void Wait( float time) {}
static int HideWarranty(); static int HideWarranty();
virtual int DisplayWarranty() { return 0;} virtual int DisplayWarranty() { return 0;}
virtual void DisplayLicense() {} virtual void DisplayLicense() {}
virtual CoWowTimer *timer_new() { return 0;} virtual CoWowTimer *timer_new() { return 0;}
virtual pwr_tStatus CreateMenuItem( const char *name, void *menu, int pixmap, int append, void *w) { return 0;} virtual pwr_tStatus CreateMenuItem( const char *name, void *menu, int pixmap, int append, void *w) { return 0;}
virtual pwr_tStatus DeleteMenuItem( const char *name, void *menu) { return 0;} virtual pwr_tStatus DeleteMenuItem( const char *name, void *menu) { return 0;}
}; };
#endif #endif
......
...@@ -501,6 +501,7 @@ class XNav { ...@@ -501,6 +501,7 @@ class XNav {
int create_object( char *classname, char *name); int create_object( char *classname, char *name);
int delete_object( char *name); int delete_object( char *name);
void print_methods(); void print_methods();
static pwr_tStatus get_instance_classgraph( char *instance_str, pwr_tFileName filename);
// Table module member functions // Table module member functions
int show_plcthreads(); int show_plcthreads();
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment