Commit b17a49ec authored by Claes Sjofors's avatar Claes Sjofors

Wb volume configuration support for renameing objects and local script

parent f7c41d59
...@@ -55,6 +55,7 @@ char default_values[][2][200] = { ...@@ -55,6 +55,7 @@ char default_values[][2][200] = {
{ "defaultProductionQbus", "1"}, { "defaultProductionQbus", "1"},
{ "defaultSimulationQbus", "999"}, { "defaultSimulationQbus", "999"},
{ "defaultNodeHierRoot", "Nodes"}, { "defaultNodeHierRoot", "Nodes"},
{ "defaultSecurity", "Security"},
{ "defaultOpPlaces", "OpPlaces"}, { "defaultOpPlaces", "OpPlaces"},
{ "defaultServers", "Servers"}, { "defaultServers", "Servers"},
{ "defaultIO", "IO"}, { "defaultIO", "IO"},
...@@ -62,6 +63,7 @@ char default_values[][2][200] = { ...@@ -62,6 +63,7 @@ char default_values[][2][200] = {
{ "defaultOpOp", "Op"}, { "defaultOpOp", "Op"},
{ "defaultOpMaintenance", "Maintenance"}, { "defaultOpMaintenance", "Maintenance"},
{ "defaultOpDefault", "OpDefault"}, { "defaultOpDefault", "OpDefault"},
{ "defaultWebBrowser", "WebBrowser"},
}; };
......
...@@ -164,6 +164,7 @@ main() ...@@ -164,6 +164,7 @@ main()
string oname; string oname;
string hw; string hw;
string os; string os;
string localscript;
verify(0); verify(0);
...@@ -642,6 +643,12 @@ page_4: ...@@ -642,6 +643,12 @@ page_4:
save/quiet save/quiet
noedit noedit
# Call local script
localscript = translate_filename( "$pwr_directoryvolume_setup");
if ( localscript != "")
@'localscript'
endif
found = 0; found = 0;
for ( i = 0; i < volcnt; i++) for ( i = 0; i < volcnt; i++)
if ( dv_vol_class[i] == 0) if ( dv_vol_class[i] == 0)
......
...@@ -77,6 +77,7 @@ main() ...@@ -77,6 +77,7 @@ main()
string current_node; string current_node;
string hw; string hw;
string os; string os;
string localscript;
verify(0); verify(0);
...@@ -259,6 +260,12 @@ page_4: ...@@ -259,6 +260,12 @@ page_4:
save/quiet save/quiet
# Call local script
localscript = translate_filename( "$pwr_rootvolume_setup");
if ( localscript != "")
@'localscript'
endif
# Build # Build
#noedit #noedit
#current_node = get_node_name(); #current_node = get_node_name();
......
...@@ -56,8 +56,65 @@ static pwr_tStatus PostCreate ( ...@@ -56,8 +56,65 @@ static pwr_tStatus PostCreate (
pwr_tStatus sts; pwr_tStatus sts;
pwr_tObjName name; pwr_tObjName name;
pwr_tOid srv_oid, opp_oid; pwr_tOid srv_oid, opp_oid;
pwr_tBoolean bval;
pwr_tUInt32 ival;
cnf_get_value( "defaultSecurity", name, sizeof(name));
sts = ldh_CreateObject(Session, &oid, name, pwr_eClass_Security, Object, ldh_eDest_IntoLast);
ival = 1;
cnf_get_value( "defaultXttPriv", name, sizeof(name));
if ( strcmp( name, "") != 0) {
sts = sscanf( name, "%d", &ival);
if ( sts == 1) {
sts = ldh_SetObjectPar( Session, oid, "SysBody", "DefaultXttPriv", (char *)&ival,
sizeof(ival));
if ( EVEN(sts)) return sts;
}
}
cnf_get_value( "defaultWebPriv", name, sizeof(name));
if ( strcmp( name, "") != 0) {
sts = sscanf( name, "%d", &ival);
if ( sts == 1) {
sts = ldh_SetObjectPar( Session, oid, "SysBody", "DefaultWebPriv", (char *)&ival,
sizeof(ival));
if ( EVEN(sts)) return sts;
}
}
cnf_get_value( "defaultWebSystemGroup", name, sizeof(name));
if ( strcmp( name, "") != 0) {
sts = ldh_SetObjectPar( Session, oid, "SysBody", "WebSystemGroup", (char *)name,
sizeof(name));
if ( EVEN(sts)) return sts;
}
// OpPlace objects
cnf_get_value( "defaultOpPlaces", name, sizeof(name));
sts = ldh_ClassNameToId(Session, &cid, "$NodeHier");
sts = ldh_CreateObject(Session, &opp_oid, name, cid, Object, ldh_eDest_IntoLast);
sts = ldh_CreateObject(Session, &oid, "Security", pwr_eClass_Security, Object, ldh_eDest_IntoLast); sts = ldh_ClassNameToId(Session, &cid, "OpPlace");
cnf_get_value( "defaultOpOp", name, sizeof(name));
sts = ldh_CreateObject(Session, &oid, name, cid, opp_oid, ldh_eDest_IntoLast);
cnf_get_value( "defaultOpMaintenance", name, sizeof(name));
sts = ldh_CreateObject(Session, &oid, name, cid, opp_oid, ldh_eDest_IntoLast);
cnf_get_value( "defaultOpSystemManager", name, sizeof(name));
if ( strcmp( name, "") != 0)
sts = ldh_CreateObject(Session, &oid, name, cid, opp_oid, ldh_eDest_IntoLast);
cnf_get_value( "defaultOpDefault", name, sizeof(name));
sts = ldh_CreateObject(Session, &oid, name, cid, opp_oid, ldh_eDest_IntoLast);
bval = 1;
sts = ldh_SetObjectPar( Session, oid, "RtBody", "IsDefaultOp", (char *)&bval,
sizeof(bval));
if ( EVEN(sts)) return sts;
cnf_get_value( "defaultWebBrowser", name, sizeof(name));
sts = ldh_ClassNameToId(Session, &cid, "WebBrowserConfig");
sts = ldh_CreateObject(Session, &oid, name, cid, opp_oid, ldh_eDest_IntoLast);
sts = ldh_ClassNameToId(Session, &cid, "$NodeHier");
cnf_get_value( "defaultGraphHier", name, sizeof(name));
if ( strcmp( name, "") != 0)
sts = ldh_CreateObject(Session, &oid, name, cid, opp_oid, ldh_eDest_IntoLast);
// Server objects // Server objects
cnf_get_value( "defaultServers", name, sizeof(name)); cnf_get_value( "defaultServers", name, sizeof(name));
...@@ -76,28 +133,14 @@ static pwr_tStatus PostCreate ( ...@@ -76,28 +133,14 @@ static pwr_tStatus PostCreate (
sts = ldh_ClassNameToId(Session, &cid, "StatusServerConfig"); sts = ldh_ClassNameToId(Session, &cid, "StatusServerConfig");
sts = ldh_CreateObject(Session, &oid, "StatusServer", cid, srv_oid, ldh_eDest_IntoLast); sts = ldh_CreateObject(Session, &oid, "StatusServer", cid, srv_oid, ldh_eDest_IntoLast);
// OpPlace objects // Plc process
cnf_get_value( "defaultOpPlaces", name, sizeof(name));
sts = ldh_ClassNameToId(Session, &cid, "$NodeHier");
sts = ldh_CreateObject(Session, &opp_oid, name, cid, Object, ldh_eDest_IntoLast);
sts = ldh_ClassNameToId(Session, &cid, "OpPlace");
cnf_get_value( "defaultOpOp", name, sizeof(name));
sts = ldh_CreateObject(Session, &oid, name, cid, opp_oid, ldh_eDest_IntoLast);
cnf_get_value( "defaultOpMaintenance", name, sizeof(name));
sts = ldh_CreateObject(Session, &oid, name, cid, opp_oid, ldh_eDest_IntoLast);
cnf_get_value( "defaultOpDefault", name, sizeof(name));
sts = ldh_CreateObject(Session, &oid, name, cid, opp_oid, ldh_eDest_IntoLast);
sts = ldh_ClassNameToId(Session, &cid, "PlcProcess"); sts = ldh_ClassNameToId(Session, &cid, "PlcProcess");
sts = ldh_CreateObject(Session, &oid, "Plc", cid, Object, ldh_eDest_IntoLast); sts = ldh_CreateObject(Session, &oid, "Plc", cid, Object, ldh_eDest_IntoLast);
// Web handler
sts = ldh_ClassNameToId(Session, &cid, "WebHandler"); sts = ldh_ClassNameToId(Session, &cid, "WebHandler");
sts = ldh_CreateObject(Session, &oid, "WebHandler", cid, Object, ldh_eDest_IntoLast); sts = ldh_CreateObject(Session, &oid, "WebHandler", cid, Object, ldh_eDest_IntoLast);
sts = ldh_ClassNameToId(Session, &cid, "WebBrowserConfig");
sts = ldh_CreateObject(Session, &oid, "WebBrowser", cid, Object, ldh_eDest_IntoLast);
// IO // IO
cnf_get_value( "defaultIO", name, sizeof(name)); cnf_get_value( "defaultIO", name, sizeof(name));
sts = ldh_ClassNameToId(Session, &cid, "$NodeHier"); sts = ldh_ClassNameToId(Session, &cid, "$NodeHier");
......
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