# HG changeset patch # User paul # Date 2014-12-16 06:46:02 # Node ID 2e8a1244670be60bdbf5ac132e2386056f71bde8 # Parent d2561e02408b30f4731b577ddb2d2fdbe8eb7eb8 Added a few scripts diff --git a/python_scripts/LFRControlPlugin.py b/python_scripts/LFRControlPlugin.py new file mode 100644 --- /dev/null +++ b/python_scripts/LFRControlPlugin.py @@ -0,0 +1,29 @@ +#!/usr/bin/lppmon -e + +import time + +proxy.loadSysDriver("SpwPlugin","SpwPlugin0") +SpwPlugin0.selectBridge("STAR-Dundee Spw USB Brick") + +proxy.loadSysDriverToParent("dsu3plugin","SpwPlugin0") +proxy.loadSysDriverToParent("LFRControlPlugin","SpwPlugin0") + +availableBrickCount = SpwPlugin0.StarDundeeGetAvailableBrickCount() +print "availableBrickCount = ", availableBrickCount + +SpwPlugin0.StarDundeeSelectBrick(1) +SpwPlugin0.StarDundeeSetBrickAsARouter(1) +SpwPlugin0.connectBridge() + +#SpwPlugin0.TCPServerSetIP("127.0.0.1") +SpwPlugin0.TCPServerConnect() + +#LFRControlPlugin0.SetSpwServerIP(129,104,27,164) +LFRControlPlugin0.TCPServerConnect() + +dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw") +dsu3plugin0.loadFile() +dsu3plugin0.run() + +LFRControlPlugin0.TMEchoBridgeOpenPort() + diff --git a/python_scripts/LFRControlPlugin_reload_all.py b/python_scripts/LFRControlPlugin_reload_all.py new file mode 100644 --- /dev/null +++ b/python_scripts/LFRControlPlugin_reload_all.py @@ -0,0 +1,17 @@ +# LOAD TIMEGEN USING LINK 2 +SpwPlugin0.StarDundeeSelectLinkNumber( 2 ) +dsu3plugin0.openFile("/opt/DEV_PLE/timegen-qt/bin/timegen") +dsu3plugin0.loadFile() +dsu3plugin0.run() + +# LOAD FSW USING LINK 1 +SpwPlugin0.StarDundeeSelectLinkNumber( 1 ) +dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw") +dsu3plugin0.loadFile() +dsu3plugin0.run() + +# START SENDING TIMECODES AT 1 Hz +SpwPlugin0.StarDundeeStartTimecodes( 1 ) + +# it is possible to change the time code frequency +#RMAPPlugin0.changeTimecodeFrequency(2) diff --git a/python_scripts/LFRControlPlugin_setup.py b/python_scripts/LFRControlPlugin_setup.py new file mode 100644 --- /dev/null +++ b/python_scripts/LFRControlPlugin_setup.py @@ -0,0 +1,30 @@ +import time + +proxy.loadSysDriver("SpwPlugin","SpwPlugin0") +SpwPlugin0.selectBridge("STAR-Dundee Spw USB Brick") + +proxy.loadSysDriverToParent("dsu3plugin","SpwPlugin0") +proxy.loadSysDriverToParent("LFRControlPlugin","SpwPlugin0") + +availableBrickCount = SpwPlugin0.StarDundeeGetAvailableBrickCount() +print str(availableBrickCount) + " SpaceWire brick(s) found" + +SpwPlugin0.StarDundeeSelectBrick(1) +SpwPlugin0.StarDundeeSetBrickAsARouter(1) +SpwPlugin0.connectBridge() + +#SpwPlugin0.TCPServerSetIP("127.0.0.1") +SpwPlugin0.TCPServerConnect() + +# OPEN SPACEWIRE SERVER +#LFRControlPlugin0.SetSpwServerIP(129,104,27,164) +LFRControlPlugin0.TCPServerConnect() + +# OPEN TM ECHO BRIDGE SERVER +LFRControlPlugin0.TMEchoBridgeOpenPort() + +# START SENDING TIMECODES AT 1 Hz +SpwPlugin0.StarDundeeStartTimecodes( 1 ) + +# it is possible to change the time code frequency +#RMAPPlugin0.changeTimecodeFrequency(2) diff --git a/python_scripts/LFRControlPlugin_startAll.py b/python_scripts/LFRControlPlugin_startAll.py new file mode 100644 --- /dev/null +++ b/python_scripts/LFRControlPlugin_startAll.py @@ -0,0 +1,42 @@ +import time + +proxy.loadSysDriver("SpwPlugin","SpwPlugin0") +SpwPlugin0.selectBridge("STAR-Dundee Spw USB Brick") + +proxy.loadSysDriverToParent("dsu3plugin","SpwPlugin0") +proxy.loadSysDriverToParent("LFRControlPlugin","SpwPlugin0") + +availableBrickCount = SpwPlugin0.StarDundeeGetAvailableBrickCount() +print str(availableBrickCount) + " SpaceWire brick(s) found" + +SpwPlugin0.StarDundeeSelectBrick(1) +SpwPlugin0.StarDundeeSetBrickAsARouter(1) +SpwPlugin0.connectBridge() + +#SpwPlugin0.TCPServerSetIP("127.0.0.1") +SpwPlugin0.TCPServerConnect() + +# OPEN SPACEWIRE SERVER +#LFRControlPlugin0.SetSpwServerIP(129,104,27,164) +LFRControlPlugin0.TCPServerConnect() + +# OPEN TM ECHO BRIDGE SERVER +LFRControlPlugin0.TMEchoBridgeOpenPort() + +# LOAD TIMEGEN USING LINK 2 +SpwPlugin0.StarDundeeSelectLinkNumber( 2 ) +dsu3plugin0.openFile("/opt/DEV_PLE/timegen-qt/bin/timegen") +dsu3plugin0.loadFile() +dsu3plugin0.run() + +# LOAD FSW USING LINK 1 +SpwPlugin0.StarDundeeSelectLinkNumber( 1 ) +dsu3plugin0.openFile("/opt/DEV_PLE/FSW-qt/bin/fsw") +dsu3plugin0.loadFile() +dsu3plugin0.run() + +# START SENDING TIMECODES AT 1 Hz +SpwPlugin0.StarDundeeStartTimecodes( 1 ) + +# it is possible to change the time code frequency +#RMAPPlugin0.changeTimecodeFrequency(2)