Project

General

Profile

Bug #507 ยป dump_par_vs_source.py

Veronique bouzid, 29/09/2015 02:56 PM

 
1
# -*- coding: utf-8 *-*
2

    
3
###############################################################################
4
# SVS-0029 (SSS-CP-EQS-260, REQ-RPW-SYS-0303)
5
###############################################################################
6
# execfile('/opt/PYTHON/lfrverif/LFR_SVS/SVS-0029/normal_mode_parameter_set.py')
7
#import sys
8

    
9
## To ensure the imported modified files are properly reloaded.
10
#for mod in sys.modules.values():
11
    #strmod = str(mod)
12
    #if not ('\'PythonQt' in strmod) and not ('\'sys\'' in strmod) and \
13
        #not ('\'pygments.' in strmod) and \
14
        #not ('\'__main__\'' in strmod) and not ('\'paste\'' in strmod) and \
15
        #not ('\'/usr/lib64/python2.7/' in strmod) and not(mod is None):
16
    #if ('\'lfrverif' in strmod):
17
        #print mod
18
        #reload(mod)
19

    
20
import inspect
21
from lfrverif.common.param import *
22

    
23
# setting up LPPMON plugins
24
from __main__ import proxy
25
if not(proxy.instanceExists("SpwPlugin0")):
26
    proxy.loadSysDriver("SpwPlugin","SpwPlugin0")
27
    SpwPlugin0.selectBridge("STAR-Dundee Spw USB Brick")
28

    
29
    proxy.loadSysDriverToParent("dsu3plugin","SpwPlugin0")
30
    proxy.loadSysDriverToParent("LFRControlPlugin","SpwPlugin0")
31

    
32
    availableBrickCount = SpwPlugin0.StarDundeeGetAvailableBrickCount()
33
    print str(availableBrickCount) + " SpaceWire brick(s) found"
34

    
35
    SpwPlugin0.StarDundeeSelectBrick(1)
36
    SpwPlugin0.StarDundeeSetBrickAsARouter(1)
37
    SpwPlugin0.connectBridge()
38

    
39
    #SpwPlugin0.TCPServerSetIP("127.0.0.1")
40
    SpwPlugin0.TCPServerConnect()
41

    
42
    # OPEN SPACEWIRE SERVER
43
    #LFRControlPlugin0.SetSpwServerIP(129,104,27,164)
44
    LFRControlPlugin0.TCPServerConnect()
45

    
46
    # OPEN TM ECHO BRIDGE SERVER
47
    LFRControlPlugin0.TMEchoBridgeOpenPort()
48

    
49
    # LOAD FSW USING LINK 1
50
    SpwPlugin0.StarDundeeSelectLinkNumber( 1 )
51
    dsu3plugin0.openFile(LFR_FSW_PATH)
52
    dsu3plugin0.loadFile()
53
    dsu3plugin0.run()
54

    
55
from __main__ import SpwPlugin0
56

    
57
from lfrverif.common.actions_tc_lfr_launcher import *
58
from lfrverif.PacketsDef.tc_def import *
59
from lfrverif.common.test_monitor import *
60

    
61
current_file = inspect.currentframe().f_code.co_filename
62

    
63
test_launcher = TestLauncher(LFRControlPlugin0)
64
test_launcher.test_monitor.progress_memo += (
65
    "SocExplorerEngine.getSocExplorer: Version = " + SocExplorerEngine.getSocExplorerVersion() +
66
    ", Branch = " + SocExplorerEngine.getSocExplorerBranch() +
67
    ", Changeset = " + SocExplorerEngine.getSocExplorerChangeset() + '\n')
68

    
69
test_launcher.test_monitor.log_memo(current_file)
70
# Gerald dit de remplacer cette cde
71
#postponeNextTimeBeforeTc(1)
72
surveyAnyTmPacket(test_launcher, 1)
73

    
74
test_launcher.test_monitor.log_memo("test TC_LFR_DUMP_PAR")
75

    
76
ACK_EXECUTION_COMPLETION = 1
77
ACK_ACCEPTANCE = 1
78
SOURCE_ID = SOURCE_ID_ENUM[0]
79

    
80
tc_lfr_enter_mode = TcLfrEnterMode()
81
tc_lfr_dump_par = TcLfrDumpPar()
82
# tc_lfr_load_common_par = TcLfrLoadCommonPar()
83
tc_lfr_load_normal_par = TcLfrLoadNormalPar()
84

    
85
init_tc_header([tc_lfr_load_normal_par, tc_lfr_enter_mode, tc_lfr_dump_par],
86
    ACK_EXECUTION_COMPLETION, ACK_ACCEPTANCE, SOURCE_ID)
87

    
88

    
89
spare = tc_lfr_enter_mode.SpW[SPW_HEADER_SIZE + 11] & 0xf0
90

    
91
# Gerald dit de remplacer cette cde
92
#postponeNextTimeBeforeTc(2)
93
surveyAnyTmPacket(test_launcher, 2)
94

    
95
for cp_lfr_mode in range(5):
96
    tc_lfr_enter_mode.SpW[SPW_HEADER_SIZE + 11] = spare | (cp_lfr_mode & 0xf)
97
    dispCrcSendSpwTcWaitVerifPkt(test_launcher, tc_lfr_enter_mode)
98
    for src_id in SOURCE_ID_ENUM:
99
        tc_lfr_dump_par.SpW[SPW_HEADER_SIZE + 9] = src_id & 0xff
100
        dispCrcSendSpwTcWaitVerifPkt(test_launcher, tc_lfr_dump_par)
101
        surveyAnyTmPacket(test_launcher, 1)
102

    
103
# STANDBY (end of test case)
104
# nb: ensure last step ends with default values
105
surveyAnyTmPacket(test_launcher, 4)
106

    
107
test_launcher.test_monitor.log_memo("End(" + current_file + ")")
108
test_launcher.test_monitor.archivalRecord()
    (1-1/1)