Commit 1e0c76df authored by claes's avatar claes

Get defaultvalues from config file

parent 98392350
!** Description: Initial configuration of directory volume !** Description: Initial configuration of directory volume
# #
# Proview $Id: wb_wiz_directoryvolume.pwr_com,v 1.4 2008-10-09 08:37:51 claes Exp $ # Proview $Id: wb_wiz_directoryvolume.pwr_com,v 1.5 2008-10-28 09:49:00 claes Exp $
# Copyright (C) 2005 SSAB Oxelsund AB. # Copyright (C) 2005 SSAB Oxelsund AB.
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
...@@ -72,9 +72,9 @@ endfunction ...@@ -72,9 +72,9 @@ endfunction
main() main()
extern string pwr_wizard_title = "Configure Directory Volume"; extern string pwr_wizard_title = "Configure Directory Volume";
extern string dv_system_name; extern string dv_system_name;
extern string dv_system_group = "Common"; extern string dv_system_group;
extern int dv_prd_qbus = 1; extern int dv_prd_qbus;
extern int dv_sim_qbus = 999; extern int dv_sim_qbus;
extern int dv_quit = 0; extern int dv_quit = 0;
extern int dv_prev = 0; extern int dv_prev = 0;
extern string dv_volumes[20]; extern string dv_volumes[20];
...@@ -96,7 +96,9 @@ main() ...@@ -96,7 +96,9 @@ main()
extern string dv_default_vname; extern string dv_default_vname;
extern string dv_default_vid; extern string dv_default_vid;
extern string dv_error_message; extern string dv_error_message;
extern int dv_nomorereg;
string dv_vid[20];
string project; string project;
string vol; string vol;
int volcnt; int volcnt;
...@@ -137,10 +139,17 @@ main() ...@@ -137,10 +139,17 @@ main()
int ivid2; int ivid2;
int ivid3; int ivid3;
int vid; int vid;
int first_reg = 1;
int first_sim = 1;
string tmp_fname="$pwrp_tmp/wtmp.txt"; string tmp_fname="$pwrp_tmp/wtmp.txt";
verify(0); verify(0);
dv_system_group = get_pwr_config( "defaultSystemGroup");
dv_prd_qbus = get_pwr_config( "defaultProductionQbus");
dv_sim_qbus = get_pwr_config( "defaultSimulationQbus");
if ( ! EditMode()) if ( ! EditMode())
MessageDialog("Error", "Enter edit mode before starting wizard"); MessageDialog("Error", "Enter edit mode before starting wizard");
goto exit_now; goto exit_now;
...@@ -189,10 +198,17 @@ page_1: ...@@ -189,10 +198,17 @@ page_1:
# If no volumes are registred, register a volume # If no volumes are registred, register a volume
page_2: page_2:
if ( !volcnt) if ( !volcnt)
dvname1 = extract( 1, 1, dv_system_name); page_2aa:
dvname2 = extract( 2, 80, dv_system_name); if ( first_reg)
dv_default_vname = "Vol" + toupper( dvname1) + dvname2; dvname1 = extract( 1, 1, dv_system_name);
dv_default_vid = GetNextFreeUserVid(); dvname2 = extract( 2, 80, dv_system_name);
dv_default_vname = "Vol" + toupper( dvname1) + dvname2;
dv_default_vid = GetNextFreeUserVid();
else
dv_default_vname = "";
vid++;
dv_default_vid = GetNextFreeUserVid( vid);
endif
if ( dv_default_vid == "") if ( dv_default_vid == "")
SetSubwindow( "wb_wizard_frame", "wizwin", "$pwr_exe/wb_wiz_directoryvolume_2", 1); SetSubwindow( "wb_wizard_frame", "wizwin", "$pwr_exe/wb_wiz_directoryvolume_2", 1);
...@@ -206,6 +222,11 @@ page_2a: ...@@ -206,6 +222,11 @@ page_2a:
endif endif
if ( dv_prev) if ( dv_prev)
dv_prev = 0; dv_prev = 0;
volcnt = 0;
first_reg = 1;
for ( i = 0; i < volcnt; i++)
dv_volume_found[i] = 0;
endfor
goto page_1; goto page_1;
endif endif
...@@ -282,10 +303,19 @@ page_2a: ...@@ -282,10 +303,19 @@ page_2a:
add_vid = 1; add_vid = 1;
volcnt = 1; dv_volumes[volcnt] = dv_default_vname;
dv_volumes[0] = dv_default_vname; dv_vid[volcnt] = dv_default_vid;
dv_volume_found[0] = 1; dv_volume_found[volcnt] = 1;
volcnt++;
first_reg = 0;
SetSubwindow( "wb_wizard_frame", "wizwin", "$pwr_exe/wb_wiz_directoryvolume_9", 1);
if ( dv_nomorereg)
dv_nomorereg = 0;
goto page_3;
endif
goto page_2aa;
endif endif
page_3: page_3:
...@@ -296,6 +326,11 @@ page_3: ...@@ -296,6 +326,11 @@ page_3:
endif endif
if ( dv_prev) if ( dv_prev)
dv_prev = 0; dv_prev = 0;
volcnt = 0;
first_reg = 1;
for ( i = 0; i < volcnt; i++)
dv_volume_found[i] = 0;
endfor
goto page_1; goto page_1;
endif endif
...@@ -333,11 +368,20 @@ page_3: ...@@ -333,11 +368,20 @@ page_3:
endif endif
for ( i = 0; i < rvolcnt; i++) for ( i = 0; i < rvolcnt; i++)
dv_node_name = tolower( rootvolumes[i]); if ( first_sim && !dv_node_skip_inv)
if ( extract( 1, 3, dv_node_name) == "vol") dv_node_name = get_node_name();
dv_node_name = extract( 4, 100, dv_node_name); first_sim = 0;
else
dv_node_name = tolower( rootvolumes[i]);
if ( extract( 1, 3, dv_node_name) == "vol")
dv_node_name = extract( 4, 100, dv_node_name);
endif
endif
if ( !dv_node_skip_inv)
dv_node_ip = "127.0.0.1";
else
dv_node_ip = "0.0.0.0";
endif endif
dv_node_ip = "0.0.0.0";
dv_node_description = ""; dv_node_description = "";
dv_node_rootvolume = rootvolumes[i]; dv_node_rootvolume = rootvolumes[i];
for ( j = 0; j < addvolcnt; j++) for ( j = 0; j < addvolcnt; j++)
...@@ -361,6 +405,7 @@ page_4: ...@@ -361,6 +405,7 @@ page_4:
endif endif
if ( dv_node_skip) if ( dv_node_skip)
dv_node_skip = 0; dv_node_skip = 0;
first_sim = 0;
continue; continue;
endif endif
if ( dv_prev) if ( dv_prev)
...@@ -425,7 +470,9 @@ page_4: ...@@ -425,7 +470,9 @@ page_4:
# Add volume to global volumelist # Add volume to global volumelist
if ( add_vid) if ( add_vid)
fp = fopen( tmp_fname, "w"); fp = fopen( tmp_fname, "w");
fprintf( fp, " %s %s %s\n", dv_default_vname, dv_default_vid, dv_system_name); for ( i = 0; i < volcnt; i++)
fprintf( fp, " %s %s %s\n", dv_volumes[i], dv_vid[i], dv_system_name);
endfor
fclose( fp); fclose( fp);
cmd = "cat " + tmp_fname + " >> $pwra_db/pwr_volumelist.dat"; cmd = "cat " + tmp_fname + " >> $pwra_db/pwr_volumelist.dat";
...@@ -556,6 +603,7 @@ exit_now: ...@@ -556,6 +603,7 @@ exit_now:
delete dv_default_vname; delete dv_default_vname;
delete dv_default_vid; delete dv_default_vid;
delete dv_error_message; delete dv_error_message;
delete dv_nomorereg;
endmain endmain
......
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