diff --git a/.gitattributes b/.gitattributes index 91c09b3b2134035fc850ee1a4512de7628e81c54..7c8b9e8ece8a8b5a334ea76f6733964893f9f17e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4036,6 +4036,7 @@ MAC/Navigator2/config/progs.maincu -text MAC/Navigator2/config/progs.navigator -text MAC/Navigator2/config/progs.navigator_3.14 -text MAC/Navigator2/config/progs.standalone.station -text +MAC/Navigator2/config/progs_SNMP -text MAC/Navigator2/config/progs_wincc.ccu -text MAC/Navigator2/config/progs_wincc.dist.station -text MAC/Navigator2/config/progs_wincc.maincu -text diff --git a/MAC/Deployment/data/PVSS/data/PVSSbase.dpdef b/MAC/Deployment/data/PVSS/data/PVSSbase.dpdef index 7015a7e00bbd95d1043350a3da6a8fd1c6f8119e..9c2e4166fa127f09b6ced8365ce2ccefec75e75c 100644 --- a/MAC/Deployment/data/PVSS/data/PVSSbase.dpdef +++ b/MAC/Deployment/data/PVSS/data/PVSSbase.dpdef @@ -168,6 +168,7 @@ __resetObjectStates NCFObjectStates # DpValue ElementName TypeName _original.._value scriptInfo.transferMPs.runDone ScriptInfo 0 +scriptInfo.setSumAlerts.runDone ScriptInfo 1 _ValueArchive_2.size.maxDpElGet _ValueArchive 15000 _ValueArchive_2.size.maxDpElSet _ValueArchive 15000 _ValueArchive_2.size.maxValuesSet _ValueArchive 1250 diff --git a/MAC/Deployment/data/PVSS/data/PowerUnit.dpdef b/MAC/Deployment/data/PVSS/data/PowerUnit.dpdef index 196bac569eee7cb8b3a5530e247b918dbcc3a733..e854b55e695a21579953c9c05904a29c6155ce01 100644 --- a/MAC/Deployment/data/PVSS/data/PowerUnit.dpdef +++ b/MAC/Deployment/data/PVSS/data/PowerUnit.dpdef @@ -18,7 +18,7 @@ clearAlarmHistory int ?# Datapoint/DpId ?DpName TypeName ?_2_SNMPAgent_1 _SNMPAgent -?_2_SNMPAgent_2 _SNMPAgent +?_2_SNMPAgent_2 _SNMPAgent ?# Aliases/Comments ?AliasId AliasName CommentName diff --git a/MAC/Navigator2/config/CMakeLists.txt b/MAC/Navigator2/config/CMakeLists.txt index cc1bbccd51310f609202a509fe67e524bb531a33..405e03f98bd2bc3ddf74741e1f563abb121749d1 100644 --- a/MAC/Navigator2/config/CMakeLists.txt +++ b/MAC/Navigator2/config/CMakeLists.txt @@ -11,6 +11,7 @@ install(FILES config.level.station progs.ccu progs.maincu + progs_SNMP progs.standalone.station progs.dist.station progs_wincc.ccu diff --git a/MAC/Navigator2/config/progs_SNMP b/MAC/Navigator2/config/progs_SNMP new file mode 100644 index 0000000000000000000000000000000000000000..390e2527c4c6006cf29ad7721a49ab57049db5e1 --- /dev/null +++ b/MAC/Navigator2/config/progs_SNMP @@ -0,0 +1,15 @@ +version 1 + +auth "" "" +#Manager | Start | SecKill | Restart# | ResetMin | Options +PVSS00pmon | manual | 30 | 3 | 1 | +PVSS00data | always | 30 | 3 | 1 | +PVSS00valarch | always | 30 | 3 | 1 |-num 0 +PVSS00valarch | always | 30 | 3 | 1 |-num 2 +PVSS00valarch | always | 30 | 3 | 1 |-num 3 +PVSS00event | always | 30 | 3 | 1 | +PVSS00ctrl | always | 30 | 3 | 1 |-f pvss_scripts.lst +PVSS00sim | always | 30 | 3 | 1 | +PVSS00dist | always | 30 | 3 | 1 | +PVSS00ui | manual | 30 | 2 | 2 |-m para -display localhost:10.0 +PVSS00snmp | always | 30 | 2 | 2 |-num 2 diff --git a/MAC/Navigator2/config/progs_wincc.ccu b/MAC/Navigator2/config/progs_wincc.ccu index ba03ef79e3e11fbcfb6f84fbd4b8454dcce4edd5..581a6af341d7d1f11782f0793ebe575b3df5634e 100644 --- a/MAC/Navigator2/config/progs_wincc.ccu +++ b/MAC/Navigator2/config/progs_wincc.ccu @@ -19,4 +19,5 @@ WCCOActrl | always | 30 | 2 | 2 |monitorStateChanges.ct WCCOActrl | once | 30 | 2 | 2 |readStationConnections.ctl WCCOActrl | always | 30 | 2 | 2 |monitorStateReset.ctl WCCOActrl | always | 30 | 2 | 2 |transferMPs.ctl +WCCOAsnmp | always | 30 | 2 | 2 |-num 2 WCCOAui | manual | 30 | 2 | 2 |-m para diff --git a/MAC/Navigator2/config/progs_wincc.maincu b/MAC/Navigator2/config/progs_wincc.maincu index f25320d0378a08e2252c8b3ea88bb8f4e2fd1b2b..881922c60c6172804db04d470664b0c14fd1a03e 100644 --- a/MAC/Navigator2/config/progs_wincc.maincu +++ b/MAC/Navigator2/config/progs_wincc.maincu @@ -17,6 +17,7 @@ WCCOActrl | always | 30 | 2 | 2 |monitorAlarms.ctl WCCOActrl | always | 30 | 2 | 2 |gcf_cwd.ctl WCCOActrl | always | 30 | 2 | 2 |transferMPs.ctl WCCOActrl | always | 30 | 2 | 2 |setSumAlerts.ctl +WCCOAsnmp | always | 30 | 2 | 2 |-num 2 WCCOAui | manual | 30 | 2 | 2 |-m para -display localhost:10.0 diff --git a/MAC/Navigator2/scripts/transferMPs.ctl b/MAC/Navigator2/scripts/transferMPs.ctl index 632cbc3f43aacd0922d8c09df4d7dc44118f0a84..a467db81b0a391d61b604938584cad014b0e90b7 100644 --- a/MAC/Navigator2/scripts/transferMPs.ctl +++ b/MAC/Navigator2/scripts/transferMPs.ctl @@ -12,7 +12,7 @@ void main() if (dpExists("scriptInfo.transferMPs.debug")) { dpConnect("debugCB",true,"scriptInfo.transferMPs.debug"); } else { - DebugTN("transferMPs.ctl:main|scriptInfo.transferMPs.debugpoint not found in Database"); + DebugTN("transferMPs.ctl:main|scriptInfo.transferMPs.debugpoint not found in bbase"); } if (dpExists("scriptInfo.transferMPs.runDone")) { @@ -35,10 +35,6 @@ void main() } else { DebugTN("transferMPs.ctl:main|set leafpoints to value in mp failed"); } - - // if on a station, determine the ip adres to construct the ip adres of the POEWEC(S) write them in then database - // and set the manager active - } private void debugCB(string dp1, bool debug) { @@ -53,10 +49,11 @@ private void startTransferMP(string dp1, bool done ) { string sDestinationDPE; if (done) return; + + startTransferMP_Embedded(); - DebugTN("transferMPs.ctl:main|start transfer of MPconfigs to all DP's"); + DebugTN("transferMPs.ctl:main|start transfer of MPconfigs to all DP's"); - string query="SELECT '_original.._value' FROM '_mp_*'"; dyn_dyn_anytype tab; dyn_string dps; @@ -71,12 +68,12 @@ private void startTransferMP(string dp1, bool done ) { } } } - + for (k=1;k <= dynlen(dps); k++) { string dpstr = dps[k]; dyn_string dsDpes = dpNames( dpstr + ".**"), dsDps = dpNames("*",dpTypeName(dpstr)); - + // no datapoints found if ( dynlen(dsDps) > 1 ) { @@ -108,6 +105,10 @@ private void startTransferMP(string dp1, bool done ) { } } dpSet("scriptInfo.transferMPs.runDone",true); + + // fire setSumAlerts now that the database is complete + dpSet("scriptInfo.setSumAlerts.runDone",false); + DebugTN("MPTransfer Done."); } @@ -213,3 +214,99 @@ bool skipDP(string dp) { if (strpos(dp,"MODE_CMD") > -1) return true; return false; } + + + + + +void startTransferMP_Embedded() +{ + int x, y; + dyn_dyn_anytype ddaData; + dyn_dyn_string ddsRefs; + dyn_string dsDPs; + dyn_string dsDPTs; + + DebugTN("========== transferMPs.ctl:main|start transfer of embedded MPconfigs to all master DP's"); + + string strQuery = "SELECT '_original.._value' FROM '_mp_*'"; + dpQuery( strQuery,ddaData ); + + for( x=2; x<=dynlen(ddaData); x++) + { + string strDP = dpSubStr( ddaData[x][1], DPSUB_DP ); + string strDPT = dpTypeName(strDP); + + if( skipDP( strDP ) ) + { + continue; + } + + if (dynContains(dsDPTs, strDPT)) + { + continue; + } + + dynAppend(dsDPTs,strDPT); + + + // Get all DP-Types that has reference to this DP-type + ddsRefs = dpGetRefsToDpType( strDPT ); + + for( y=1; y<=dynlen(ddsRefs); y++ ) + { + if( dynlen(ddsRefs[y]) != 2 ) + continue; + + string strDPTsource = strDPT; + string strDPTtarget = ddsRefs[y][1]; + string strDPEtarget = ddsRefs[y][2]; + + CopyEmbbeddedMasterDP( strDPTsource, strDPTtarget, strDPEtarget ); + } + } + + DebugTN("========== transfer of embedded MPconfigs to all master DP's done"); + +} + + + +// Copies the master-datapoint configs of the given datapoint type 'strDPTsource' to the master-datapoint of the given type 'strDPTtarget' +void CopyEmbbeddedMasterDP( string strDPTsource, string strDPTtarget, string strDPTtargetElement ) +{ + int x, iError; + string strDPsource, strDPtarget, strDPEsource, strDPEtarget; + dyn_string dsDPEsSource; + dyn_string dsConfigs = makeDynString( "_distrib", "_address", "_archive", "_alert_hdl", + "_cmd_conv", "_msg_conv", + "_default", "_dp_fct", "_pv_range", + "_smooth", "_u_range", "_auth", + "_alert_class", "_original" ); + + + strDPsource = "_mp_" + strDPTsource; + strDPtarget = "_mp_" + strDPTtarget; + + strDPsource = dpSubStr( strDPsource, DPSUB_DP ); + strDPtarget = dpSubStr( strDPtarget, DPSUB_DP ); + + if( !dpExists( strDPsource ) ) + return; + + if( !dpExists( strDPtarget ) ) + return; + + dsDPEsSource = dpNames( strDPsource + ".**" ); + + if (bDebug) DebugN( "CopyEmbbeddedMasterDP(): Copy config from " + dynlen(dsDPEsSource) + " DPE's of '" + strDPsource + "' to '" + strDPtarget + "." + strDPTtargetElement +"'" ); + for( x=1; x<=dynlen(dsDPEsSource); x++ ) + { + strDPEsource = dpSubStr( dsDPEsSource[x], DPSUB_DP_EL ); + + strDPEtarget = strDPtarget + "." + strDPTtargetElement + strltrim( strDPEsource, strDPsource ); + + if (bDebug)DebugN( "Copy " + strDPEsource + " -> " + strDPEtarget ); + dpCopyConfig( strDPEsource, strDPEtarget, dsConfigs, iError); + } +}