Commit 872b8949 authored by claes's avatar claes

Functionality to show volumes and users added

parent 89c60dbb
This diff is collapsed.
...@@ -26,6 +26,21 @@ typedef enum { ...@@ -26,6 +26,21 @@ typedef enum {
admin_eDiaFunction_Prop admin_eDiaFunction_Prop
} admin_eDiaFunction; } admin_eDiaFunction;
typedef enum {
admin_eDiaUserFunction_New,
admin_eDiaUserFunction_Prop
} admin_eDiaUserFunction;
typedef enum {
admin_eDiaSysFunction_New,
admin_eDiaSysFunction_Prop
} admin_eDiaSysFunction;
typedef enum {
admin_eDiaVolFunction_New,
admin_eDiaVolFunction_Prop
} admin_eDiaVolFunction;
class Admin { class Admin {
public: public:
Admin( Admin(
...@@ -43,6 +58,12 @@ class Admin { ...@@ -43,6 +58,12 @@ class Admin {
Widget cmd_prompt; Widget cmd_prompt;
Widget cmd_input; Widget cmd_input;
Widget adminnav_form; Widget adminnav_form;
Widget proj_entry;
Widget volume_entry;
Widget user_entry;
Widget menu_project;
Widget menu_edit;
Widget adminprop_dia; Widget adminprop_dia;
Widget adminprop_projname; Widget adminprop_projname;
Widget adminprop_base; Widget adminprop_base;
...@@ -54,6 +75,47 @@ class Admin { ...@@ -54,6 +75,47 @@ class Admin {
Widget adminprop_path_noe; Widget adminprop_path_noe;
Widget adminprop_hier_noe; Widget adminprop_hier_noe;
Widget adminprop_descript_noe; Widget adminprop_descript_noe;
Widget adminuser_dia;
Widget adminuser_username;
Widget adminuser_password;
Widget adminuser_system;
Widget adminuser_username_noe;
Widget adminuser_system_noe;
Widget adminuser_priv_rtread;
Widget adminuser_priv_rtwrite;
Widget adminuser_priv_system;
Widget adminuser_priv_maintenance;
Widget adminuser_priv_process;
Widget adminuser_priv_instrument;
Widget adminuser_priv_operator1;
Widget adminuser_priv_operator2;
Widget adminuser_priv_operator3;
Widget adminuser_priv_operator4;
Widget adminuser_priv_operator5;
Widget adminuser_priv_operator6;
Widget adminuser_priv_operator7;
Widget adminuser_priv_operator8;
Widget adminuser_priv_operator9;
Widget adminuser_priv_operator10;
Widget adminuser_priv_devread;
Widget adminuser_priv_devplc;
Widget adminuser_priv_devconfig;
Widget adminuser_priv_devclass;
Widget adminsys_dia;
Widget adminsys_systemname;
Widget adminsys_systemname_noe;
Widget adminsys_attr_userinherit;
Widget adminvol_dia;
Widget adminvol_volumename;
Widget adminvol_volumename_noe;
Widget adminvol_volumeid;
Widget adminvol_volumeid_noe;
Widget adminvol_projname;
Widget adminvol_projname_noe;
int input_open; int input_open;
void *object; void *object;
void (*close_cb) ( void *); void (*close_cb) ( void *);
...@@ -62,6 +124,9 @@ class Admin { ...@@ -62,6 +124,9 @@ class Admin {
int set_focus_disabled; int set_focus_disabled;
XtIntervalId focus_timerid; XtIntervalId focus_timerid;
int dia_function; int dia_function;
int diauser_function;
int diasys_function;
int diavol_function;
char copy_from_proj[80]; char copy_from_proj[80];
char modify_projname[120]; char modify_projname[120];
char modify_base[120]; char modify_base[120];
...@@ -80,9 +145,12 @@ class Admin { ...@@ -80,9 +145,12 @@ class Admin {
int scriptmode; int scriptmode;
int edit_mode; int edit_mode;
int clock_cursor; int clock_cursor;
Item *adminvol_item;
int loggedin;
void message( char severity, char *message); void message( char severity, char *message);
void set_prompt( char *prompt); void set_prompt( char *prompt);
void set_title( char *title);
int open_input(); int open_input();
int open_project(); int open_project();
int create_project(); int create_project();
...@@ -90,10 +158,23 @@ class Admin { ...@@ -90,10 +158,23 @@ class Admin {
int copy_project(); int copy_project();
int project_properties(int projname_edit, int base_edit, int project_properties(int projname_edit, int base_edit,
int path_edit, int hier_edit, int descr_edit); int path_edit, int hier_edit, int descr_edit);
int user_properties( admin_eDiaUserFunction function, int username_edit, int password_edit,
int system_edit, int priv_edit);
int system_properties( admin_eDiaSysFunction function, int systemname_edit, int attr_edit);
int volume_properties( admin_eDiaVolFunction function, int volumename_edit,
int volumeid_edit, int projectname_edit);
void adminprop_setup( char *title, int projname_edit, int base_edit, void adminprop_setup( char *title, int projname_edit, int base_edit,
int path_edit, int hier_edit, int descript_edit, int path_edit, int hier_edit, int descript_edit,
char *projname_value, char *base_value, char *path_value, char *projname_value, char *base_value, char *path_value,
char *hier_value, char *descript_value); char *hier_value, char *descript_value);
void adminuser_setup( char *title, int username_edit, int password_edit,
int system_edit, int priv_edit,
char *username_value, char *system_value, unsigned int priv_value);
void adminsys_setup( char *title, int systemname_edit, int attr_edit,
char *systemname_value, unsigned int attr_value);
void adminvol_setup( char *title, int volumename_edit, int volumeid_edit,
int projectname_edit, char *volumename_value, char *volumeidvalue,
char *projectnamevalue);
void set_clock_cursor(); void set_clock_cursor();
void reset_cursor(); void reset_cursor();
void set_clock_cursor_dia(); void set_clock_cursor_dia();
......
...@@ -119,7 +119,7 @@ static int admin_login_func( void *client_data, ...@@ -119,7 +119,7 @@ static int admin_login_func( void *client_data,
if ( EVEN(sts)) if ( EVEN(sts))
{ {
// Username and password are not required // Username and password are not required
admin->edit_mode = 1; admin->loggedin = 1;
admin->message('I', "Administrator logged in"); admin->message('I', "Administrator logged in");
return 1; return 1;
} }
...@@ -142,7 +142,7 @@ static int admin_login_func( void *client_data, ...@@ -142,7 +142,7 @@ static int admin_login_func( void *client_data,
admin->message('E',"Login failure"); admin->message('E',"Login failure");
else else
{ {
admin->edit_mode = 1; admin->loggedin = 1;
sprintf( msg, "User %s logged in", arg1_str); sprintf( msg, "User %s logged in", arg1_str);
admin->message('I', msg); admin->message('I', msg);
} }
...@@ -154,10 +154,10 @@ static int admin_logout_func( void *client_data, ...@@ -154,10 +154,10 @@ static int admin_logout_func( void *client_data,
{ {
Admin *admin = (Admin *)client_data; Admin *admin = (Admin *)client_data;
if ( admin->edit_mode) if ( admin->loggedin)
{ {
admin->message('I', "Administrator logged out"); admin->message('I', "Administrator logged out");
admin->edit_mode = 0; admin->loggedin = 0;
} }
else else
admin->message('I', "Not logged in"); admin->message('I', "Not logged in");
......
This diff is collapsed.
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
<Description>. */ <Description>. */
#include <iostream.h>
#if defined __cplusplus #if defined __cplusplus
extern "C" { extern "C" {
#endif #endif
...@@ -15,6 +17,11 @@ extern "C" { ...@@ -15,6 +17,11 @@ extern "C" {
#ifndef pwr_h #ifndef pwr_h
# include "pwr.h" # include "pwr.h"
#endif #endif
#ifndef co_user_h
# include "co_user.h"
#endif
#ifndef flow_h #ifndef flow_h
#include "flow.h" #include "flow.h"
#endif #endif
...@@ -29,7 +36,14 @@ extern "C" { ...@@ -29,7 +36,14 @@ extern "C" {
#define adminnav_cVersion "X3.0b" #define adminnav_cVersion "X3.0b"
typedef struct adminnav_s_Menu { typedef enum {
adminnav_eMode_Projects,
adminnav_eMode_Volumes,
adminnav_eMode_Users
} adminnav_eMode;
typedef struct adminnav_s_ProjMenu {
char name[80]; char name[80];
int item_type; int item_type;
char project[120]; char project[120];
...@@ -38,10 +52,10 @@ typedef struct adminnav_s_Menu { ...@@ -38,10 +52,10 @@ typedef struct adminnav_s_Menu {
char hierarchy[120]; char hierarchy[120];
char description[120]; char description[120];
int pixmap; int pixmap;
struct adminnav_s_Menu *child_list; struct adminnav_s_ProjMenu *child_list;
struct adminnav_s_Menu *parent; struct adminnav_s_ProjMenu *parent;
struct adminnav_s_Menu *next; struct adminnav_s_ProjMenu *next;
} adminnav_sMenu; } adminnav_sProjMenu;
typedef struct adminnav_s_Base { typedef struct adminnav_s_Base {
char name[80]; char name[80];
...@@ -52,8 +66,12 @@ typedef struct adminnav_s_Base { ...@@ -52,8 +66,12 @@ typedef struct adminnav_s_Base {
typedef enum { typedef enum {
adminnav_eItemType_ProjHier, adminnav_eItemType_ProjHier,
adminnav_eItemType_Project, adminnav_eItemType_Project,
adminnav_eItemType_Db, adminnav_eItemType_ProjDb,
adminnav_eItemType_Volume adminnav_eItemType_ProjVolume,
adminnav_eItemType_Volume,
adminnav_eItemType_VolComment,
adminnav_eItemType_User,
adminnav_eItemType_UsersGroup
} adminnav_eItemType; } adminnav_eItemType;
typedef enum { typedef enum {
...@@ -84,16 +102,27 @@ class AdminNav { ...@@ -84,16 +102,27 @@ class AdminNav {
int trace_started; int trace_started;
void (*message_cb)( void *, char, char *); void (*message_cb)( void *, char, char *);
int (*set_focus_cb)( void *, void *); int (*set_focus_cb)( void *, void *);
adminnav_sMenu *menu_tree; adminnav_sProjMenu *proj_menu_tree;
adminnav_sBase *baselist; adminnav_sBase *baselist;
int displayed; int displayed;
adminnav_eMode mode;
GeUser *gu;
void message( char sev, char *text); void message( char sev, char *text);
void tree_build(); void proj_tree_build();
void tree_load(); void proj_tree_load();
void tree_free(); void proj_tree_free();
void volumes_tree_build();
void volumes_tree_free();
void users_tree_build();
void users_tree_free();
int volumes_save();
int volumes_add( char *volumename, char *volumeid, char *projectname,
brow_tNode node, flow_eDest dest);
void volumes_delete( brow_tNode node);
void set_inputfocus( int focus); void set_inputfocus( int focus);
void insert_tree( adminnav_sMenu *menu, adminnav_sMenu *parent, char *hierarchy); void insert_tree( adminnav_sProjMenu *menu, adminnav_sProjMenu *parent,
char *hierarchy);
void enable_events(); void enable_events();
int get_select( void **item); int get_select( void **item);
int basename_to_baseroot( char *name, char *root); int basename_to_baseroot( char *name, char *root);
...@@ -102,6 +131,7 @@ class AdminNav { ...@@ -102,6 +131,7 @@ class AdminNav {
void zoom( double zoom_factor); void zoom( double zoom_factor);
void get_zoom( double *zoom_factor); void get_zoom( double *zoom_factor);
void unzoom(); void unzoom();
void view( adminnav_eMode m);
}; };
...@@ -110,20 +140,29 @@ class Item { ...@@ -110,20 +140,29 @@ class Item {
Item( adminnav_eItemType item_type) : Item( adminnav_eItemType item_type) :
type( item_type) {}; type( item_type) {};
adminnav_eItemType type; adminnav_eItemType type;
virtual int open_children( AdminNav *adminnav, double x, double y)
{ return 0;}
virtual int close( AdminNav *adminnav, double x, double y)
{ return 0;}
virtual char *identity() { return "";}
virtual brow_tNode get_node() = 0;
virtual void print( ofstream& fp) {}
}; };
class ItemProjHier : public Item { class ItemProjHier : public Item {
public: public:
ItemProjHier( AdminNav *adminnav, char *item_name, char *item_hier, ItemProjHier( AdminNav *adminnav, char *item_name, char *item_hier,
adminnav_sMenu *item_child_list, adminnav_sProjMenu *item_child_list,
brow_tNode dest, flow_eDest dest_code); brow_tNode dest, flow_eDest dest_code);
brow_tNode node; brow_tNode node;
char name[120]; char name[120];
char hierarchy[120]; char hierarchy[120];
adminnav_sMenu *child_list; adminnav_sProjMenu *child_list;
int open_children( AdminNav *adminnav, double x, double y); int open_children( AdminNav *adminnav, double x, double y);
int close( AdminNav *adminnav, double x, double y); int close( AdminNav *adminnav, double x, double y);
char *identity() { return hierarchy;}
brow_tNode get_node() { return node;}
}; };
class ItemProject : public Item { class ItemProject : public Item {
...@@ -141,11 +180,13 @@ class ItemProject : public Item { ...@@ -141,11 +180,13 @@ class ItemProject : public Item {
char description[120]; char description[120];
int open_children( AdminNav *adminnav, double x, double y); int open_children( AdminNav *adminnav, double x, double y);
int close( AdminNav *adminnav, double x, double y); int close( AdminNav *adminnav, double x, double y);
char *identity() { return hierarchy;}
brow_tNode get_node() { return node;}
}; };
class ItemDb : public Item { class ItemProjDb : public Item {
public: public:
ItemDb( AdminNav *adminnav, char *item_name, ItemProjDb( AdminNav *adminnav, char *item_name,
char *item_project, char *item_db, char *item_root, char *item_project, char *item_db, char *item_root,
brow_tNode dest, flow_eDest dest_code); brow_tNode dest, flow_eDest dest_code);
brow_tNode node; brow_tNode node;
...@@ -156,11 +197,13 @@ class ItemDb : public Item { ...@@ -156,11 +197,13 @@ class ItemDb : public Item {
char root[120]; char root[120];
int open_children( AdminNav *adminnav, double x, double y); int open_children( AdminNav *adminnav, double x, double y);
int close( AdminNav *adminnav, double x, double y); int close( AdminNav *adminnav, double x, double y);
char *identity() { return hierarchy;}
brow_tNode get_node() { return node;}
}; };
class ItemVolume : public Item { class ItemProjVolume : public Item {
public: public:
ItemVolume( AdminNav *adminnav, char *item_name, ItemProjVolume( AdminNav *adminnav, char *item_name,
char *item_project, char *item_db, char *item_volume, char *item_root, char *item_project, char *item_db, char *item_volume, char *item_root,
brow_tNode dest, flow_eDest dest_code); brow_tNode dest, flow_eDest dest_code);
brow_tNode node; brow_tNode node;
...@@ -170,9 +213,84 @@ class ItemVolume : public Item { ...@@ -170,9 +213,84 @@ class ItemVolume : public Item {
char hierarchy[120]; char hierarchy[120];
char volume[120]; char volume[120];
char root[120]; char root[120];
char *identity() { return hierarchy;}
brow_tNode get_node() { return node;}
};
class ItemVolume : public Item {
public:
ItemVolume( AdminNav *adminnav,
char *item_name, char *item_vid, char *item_project,
brow_tNode dest, flow_eDest dest_code);
brow_tNode node;
pwr_tVolumeId vid;
char name[120];
char project[120];
char *identity() { return name;}
brow_tNode get_node() { return node;}
void modify( char *item_name, char *item_vid, char *item_project);
void print( ofstream& fp);
};
class ItemVolComment : public Item {
public:
ItemVolComment( AdminNav *adminnav,
char *item_text,
brow_tNode dest, flow_eDest dest_code);
brow_tNode node;
char text[120];
char *identity() { return text;}
brow_tNode get_node() { return node;}
void print( ofstream& fp);
};
class ItemUsersGroup : public Item {
public:
ItemUsersGroup( AdminNav *adminnav,
SystemList *item_group,
brow_tNode dest, flow_eDest dest_code);
brow_tNode node;
SystemList *group;
char name[120];
int open_children( AdminNav *adminnav, double x, double y);
int close( AdminNav *adminnav, double x, double y);
char *identity() { return name;}
brow_tNode get_node() { return node;}
};
class ItemUser : public Item {
public:
ItemUser( AdminNav *adminnav,
UserList *item_user,
brow_tNode dest, flow_eDest dest_code);
brow_tNode node;
UserList *user;
char name[120];
char *identity() { return name;}
brow_tNode get_node() { return node;}
}; };
#if defined __cplusplus #if defined __cplusplus
} }
#endif #endif
#endif #endif
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