point_cap['Kp_Fouling_PointCorrected_Trolley_Value'])

Min_RMR_Protection = int(proj_const['Min_RMR_Protection'])
Min_RMR_Protection_Forward = int(proj_const['Min_RMR_Protection_Forward'])

# Create report file
global_test_results = list()
wbReport = workbook.Workbook()
wsRpt = wbReport.active
wsRpt.title = "Test_Results"
rwCount = 1

Utility.WriteToWorkSheet(wsRpt, rwCount, [
    "ID", "RMZ", "Direction", "RMZ_Type", "Track_ID", "Kp_Begin_Value",
    "Kp_End_Value", "Min RMR Protection UpExtr 1",
    "Min RMR Protection UpExtr 2", "Min RMR Protection Dn Extr 1",
    "Min RMR Protection Dn Extr 2", "Point ID in Protection Zone",
    "Fouling Point ID in Protection Zone", "Result"
])

for index in range(len(rmz_names)):
    if rmz_type[index] == 'RMR_Per_Zones':
        rwCount = rwCount + 1
        try:
            _result = []
            _rmz = rmz_names[index].strip()
            _rmz_kp_b = rmz_kp_begin[index]
            _rmz_kp_e = rmz_kp_end[index]
            _rmz_type = rmz_type[index]
            _rmz_track = rmz_track[index]
            if _rmz_kp_b < _rmz_kp_e:
Exemplo n.º 2
0
                                rmz_cap['Kp_EndCorrected_Trolley_Value'])
rmz_trfc_list = rmz_cap['Train_Formation_Characteristics_ID_List']

sddb_name = sddb_cap['Name']
sddb_track = sddb_cap['Track_ID']
sddb_kp = Utility.SDDBKp(sddb_cap)

# Create report file
global_test_results = list()
wbReport = workbook.Workbook()
wsRpt = wbReport.active
wsRpt.title = "Test_Results"
rwCount = 1

Utility.WriteToWorkSheet(wsRpt, rwCount, [
    "RMZ", "RMZ_Type", "Track", "Kp_Begin_Value", "Kp_End_Value", "SDDB",
    "SDDB_Track", "SDDB_Kp", "Result"
])
rwCount = rwCount + 1

for index in range(len(rmz_names)):
    try:

        _rmz = rmz_names[index].strip()
        _rmz_kp_b = int(rmz_kp_begin[index])
        _rmz_kp_e = int(rmz_kp_end[index])
        _rmz_type = rmz_type[index]
        _rmz_track = rmz_track[index]
        _rmz_dir = str.upper(rmz_dir[index])
        if str.upper(rmz_type[index]) == 'RMR_PER_ZONES':

            for sdditem in range(len(sddb_name)):
Exemplo n.º 3
0
routes_cap = SyDT['Routes_Cap']
switchs_cap = SyDT['Switchs_Cap']
points_cap = SyDT['Points_Cap']
sddevices_cap = SyDT['Secondary_Detection_Devices_Cap']
sig_area_cap = SyDT['Signalisation_Areas_Cap']
sdd_id_list = sig_area_cap['Area_Boundary_Secondary_Detection_Device_ID_List']
cbi_sig_area = dict()
test_result = ''
# Create report file
global_test_results = list()
wbReport = workbook.Workbook()
wsRpt = wbReport.active
wsRpt.title = "Test_Results"
rwCount = 1
Utility.WriteToWorkSheet(
    wsRpt, rwCount,
    ["Route", "Switchs", "Point", "SDD List", "Signalisation Areas", "Result"])
rwCount = rwCount + 1

for i in range(len(sig_area_cap['Name'])):
    if sig_area_cap['Area_Type'][i] == 'CBI':
        cbi_sig_area[sig_area_cap['Name'][i]] = sdd_id_list[i].split(';')

route_names = routes_cap['Name']
switch_ids = routes_cap['Switch_ID_List']

for route in route_names:
    report = dict()
    sw_sig_area , sw_pt_list ,route_pt_list, sdd_list ,route_sdd_list= [],[],[] ,[],[]
    route_switch_ids = switch_ids[route_names.index(route)]
### =========Rule_DB_General_0001 ===============================================================
# Author : Saleem Javed
# Updated 31 May 2017
# Caps Used : All caps having column "Name",
# Constant used :  None 

###================================================================================================

# Create report file
global_test_results = list()
wbReport = workbook.Workbook()
wsRpt=wbReport.active
wsRpt.title = "Test_Results"
rwCount = 1
Utility.WriteToWorkSheet(wsRpt,rwCount,["Cap Name", "Item Name", "Other Cap Name","Cap With Duplicate Items","Result"])
rwCount = rwCount+1

# Read Caps
full_list = dict()
# Prepare dictionary of Cap and items of column "Name" 
for name, cap in SyDT.items():
    try:

        if cap.get('Name') != None:
           if len(cap['Name']) > 0:
               full_list[name] = cap['Name']
    except:
        dtvt_log.error(name ,'\t', sys.exc_info()[0])

for name, items in full_list.items():
Exemplo n.º 5
0
# Updated 11 April 2017
# Caps Used : Platforms_cap
# Constant used :  C_Late_Change_Distance
###======================================================================================================================

c_late_change_dist = Utility.Get_C_Late_Change_Distance(
    param['config'].C_Late_Change_Distance_File_Path)

# Create Report
global_test_results = list()
wbReport = workbook.Workbook()
wsRpt = wbReport.active
wsRpt.title = "Test_Results"
rwCount = 1
Utility.WriteToWorkSheet(wsRpt, rwCount, [
    "Platform", "C_Late_Change_Distance from RTI",
    "C_Late_Change_Distance from SyDT", "Result"
])
rwCount = rwCount + 1

# Read Caps
platforms_cap = SyDT['Platforms_Cap']
platform_name = platforms_cap['Name']
plt_c_late_cng_dist = platforms_cap['C_Late_Change_Distance']

for plt in platform_name:
    res = 'NOK'
    if c_late_change_dist.get(plt) == None:
        dtvt_log.error("For platform " + plt +
                       "C_Late_Change_Distance not found")
        res = 'NOK'
        global_test_results.append(res)
Exemplo n.º 6
0
sig_name = signals_cap['Name']
sig_sdd = signals_cap['Secondary_Detection_Device_ID']

sig_area_name = sig_area_cap['Name']
sig_area_type = sig_area_cap['Area_Type']
sig_area_sdd = sig_area_cap['Area_Boundary_Secondary_Detection_Device_ID_List']

# Create report file
global_test_results = list()
wbReport = workbook.Workbook()
wsRpt = wbReport.active
wsRpt.title = "Test_Results"
rwCount = 1
Utility.WriteToWorkSheet(
    wsRpt, rwCount,
    ["Route", "Origin_Signal", "SDD", "Signalisation Area", "Result"])
rwCount = rwCount + 1

for index in range(len(route_name)):
    try:
        _result = ""
        _route = route_name[index]
        _orig_sig = route_orig_signal[index]
        _sdd = sig_sdd[sig_name.index(_orig_sig)]
        _sdd_sig_area = ""
        if _sdd != '0':
            for item in range(len(sig_area_name)):
                if sig_area_type[item] == "CBI":
                    _sig_area = sig_area_name[item]
                    if _sdd in sig_area_sdd[item].split(';'):
Exemplo n.º 7
0
### =========Rule RULE_TMS_PLATF_0014 ===================================================================================
# Author : Saleem Javed
# Updated 11 April 2017
# Caps Used : Urbalis_Sectors_Cap, Platforms_cap
# Constant used :  None
###======================================================================================================================

# Create Report
global_test_results = list()
wbReport = workbook.Workbook()
wsRpt = wbReport.active
wsRpt.title = "Test_Results"
rwCount = 1
Utility.WriteToWorkSheet(wsRpt, rwCount, [
    "Urbalis Sector", "Platform", "Track", "Pre_Platform_SSP_ID_LIST", "Result"
])
rwCount = rwCount + 1

# Read Caps
urbalis_sectors_cap = SyDT['Urbalis_Sectors_Cap']
urbalis_sector_name = urbalis_sectors_cap['Name']
track_id_list = urbalis_sectors_cap['Track_ID_List']
pre_arrival = urbalis_sectors_cap['Pre_Arrival']

platforms_cap = SyDT['Platforms_Cap']
platform_name = platforms_cap['Name']
plt_track_id = platforms_cap['Track_ID']
pre_platform_ssp_id_list = platforms_cap['Pre_Platform_SSP_ID_List']

for index in range(len(urbalis_sector_name)):
Exemplo n.º 8
0
signals_cap = SyDT['Signals_Cap']
sig_name = signals_cap['Name']
sig_ssp = signals_cap['SSP_ID']
sig_kp = Utility.GetKpValue(signals_cap['KpValue'],signals_cap['KpCorrected_Trolley_Value'])

ssp_cap =  SyDT['Service_Stopping_Points_Cap']
ssp_name = ssp_cap['Name']
ssp_kp = Utility.GetKpValue(ssp_cap['KpValue'],ssp_cap['KpCorrected_Trolley_Value'])

# Create report file
global_test_results = list()
wbReport = workbook.Workbook()
wsRpt=wbReport.active
wsRpt.title = "Test_Results"
rwCount = 1
Utility.WriteToWorkSheet(wsRpt,rwCount,["Signal","Signal_Kp", "SSP","SSP_Kp", "Distance between Signal and SSP","Result"])
rwCount = rwCount+1

for index in range(len(sig_ssp)):
    if sig_ssp[index] != '0':
        try:
            _result='NOK'
            _sig = sig_name[index].strip()
            _sig_kp = sig_kp[index]
            _linked_ssp_name = sig_ssp[index]
            _linked_ssp_index = ssp_name.index(_linked_ssp_name)
            _linked_ssp_kp = ssp_kp[_linked_ssp_index]

            
             # Note: kp values are considered positive , and kps are measured in cms
             # 200 cm is taken from rule definition
Exemplo n.º 9
0
sddb_track = sddb_cap['Track_ID']

track_directions = Utility.GetTrackDirections(
    Utility.GetTrackDirectionFile(root_folder))

local_D_Joint = int(str.strip(proj_const['Local_D_Joint']))
stopping_accuracy = int(str.strip(proj_const['Stopping_Accuracy']))

# Create report file
global_test_results = list()
wbReport = workbook.Workbook()
wsRpt = wbReport.active
wsRpt.title = "Test_Results"
rwCount = 1
Utility.WriteToWorkSheet(wsRpt, rwCount, [
    "SSP", "SSP_Kp", "Stopping_Accuracy", "Loc_Error", "Local_D_Joint", "TRFC",
    "Formation_Length", "SDDB_Kp", "Result"
])
rwCount = rwCount + 1

# Logic Starts Here

for index in range(len(ssp_name)):
    _ssp = ssp_name[index]
    _ssp_kp = ssp_kp[index]
    _ssp_dir = ssp_direction[index]
    _ssp_type = Utility.GetSSPType(_ssp, platforms_cap['SSP_ID_List'],
                                   stablings_cap['SSP_ID_List'])
    _ssp_trfc = ssp_trains[index]
    _ssp_track = ssp_track[index]
    _track_sddbkp_List = list()
    _res = ""
Exemplo n.º 10
0
sddb_track = sddb_cap['Track_ID']
sddb_kp = Utility.SDDBKp(sddb_cap)

points_name = points_cap['Name']
points_track = points_cap['Track_ID']
points_kp_toe = Utility.GetKpValue(points_cap['Kp_ToeValue'],
                                   points_cap['Kp_ToeCorrected_Trolley_Value'])

# Create report file
global_test_results = list()
wbReport = workbook.Workbook()
wsRpt = wbReport.active
wsRpt.title = "Test_Results"
rwCount = 1
Utility.WriteToWorkSheet(wsRpt, rwCount, [
    "ZC", "Adjacent ZC", "SDDB", "SDDB_Track", "SDDB_Kp", "Kp1", "kp2",
    "Point", "Point_Kp_Toe", "Result"
])
rwCount = rwCount + 1
zc_sddbs = dict()

for index in range(len(sig_area_name)):
    try:
        if (sig_area_cap['Area_Type'][index] == 'ZC'):
            _result = ""
            _zc_name = sig_area_name[index]
            _temp_sddb_list = list()
            for _sdd in sig_area_sdd_list[index].split(';'):
                _sdd = str.strip(_sdd)
                for _sddb in sdd_sddb_list[sdd_name.index(_sdd)].split(';'):
                    _sddb = str.strip(_sddb)
                    _temp_sddb_list.append(_sddb)
Exemplo n.º 11
0
from DtvtLib import SydbReader
import xml.etree.ElementTree as ET

sydb_reader = SydbReader.SydbReader(config.sydb_file_path)
point_deadlock_Blocks = sydb_reader.Point_Deadlocking_Block_ID_List()
#sig_id_blk_dict =sydb_reader.Get_Signals_ID_BlockID_Pairs()


# Create Report
global_test_results = list()
wbReport = workbook.Workbook()
wsRpt=wbReport.active
wsRpt.title = "Test_Results"
rwCount = 1
Utility.WriteToWorkSheet(wsRpt,rwCount,["Signal","Track" ,"Signal Kp", "Point", "Block ID","Block Name", "Block Track", "Block Kp Begin", "Block Kp End", "Result"])
rwCount = rwCount+1

for block in sydb_reader.root_node.findall('./Blocks/Block'):
    res = ""                    
    blk_id =   int(block.attrib['ID'])
    blk_name =  block.attrib['Name']                    
    blk_kp_begin = int(block.find('Kp_Begin').text)
    blk_kp_end = int(block.find('Kp_End').text)  
    blk_trk = int(block.find('Track_ID').text)
    for point in  sydb_reader.root_node.findall('./Points/Point'):
        pt_name = point.attrib['Name']   
        if blk_id in point_deadlock_Blocks[pt_name]:
            for signal in sydb_reader.root_node.findall('./Signals/Signal'):
                sig_type = str.upper(signal.find('Signal_Type_Function').text)
                signal_name = signal.attrib['Name']
Exemplo n.º 12
0
### =========Rule_WZ_0002===============================================================
# Author : Saleem Javed
# Updated 23 May 2017
# Caps Used : Projects_Cap,
# Constant used :  None

###================================================================================================

# Create report file
global_test_results = list()
wbReport = workbook.Workbook()
wsRpt = wbReport.active
wsRpt.title = "Test_Results"
rwCount = 1
Utility.WriteToWorkSheet(
    wsRpt, rwCount, ["Project Name", "Max_Blocks_With_Work_Zone", "Result"])
rwCount = rwCount + 1

# Read Caps
project_cap = SyDT['Projects_Cap']
project_names = project_cap['Name']
Max_Blocks_With_Work_Zone = project_cap['Max_Blocks_With_Work_Zone']
_result = ''
for index in range(len(project_names)):
    proj_name = project_names[index]
    max_blocks_with_wz = int(Max_Blocks_With_Work_Zone[index])
    if max_blocks_with_wz <= 1000:
        _result = 'OK'
        global_test_results.append('OK')
        dtvt_log.info(
            'Project ' + proj_name +
# Updated 23 May 2017
# Caps Used : Sydb Nodes Platforms,Change_Of_Direction_Areas,Stablings_Location,Isolation_Areas
#                        Coupling_Uncoupling_Areas,Washing_Zones,Transfer_Tracks,
# Constant used :  None
# GFPD : 0962_AR
###================================================================================================

# Create report file
global_test_results = list()
wbReport = workbook.Workbook()
wsRpt = wbReport.active
wsRpt.title = "Test_Results"
rwCount = 1
Utility.WriteToWorkSheet(wsRpt, rwCount, [
    "Original_Area", "Track", "Original_Area_Type", "Stopping_Area", "KpEnd",
    "KpEnd", "Original_Area2", "Track", "Original_Area_Type", "Stopping_Area",
    "KpEnd", "KpEnd", "Result"
])
rwCount = rwCount + 1

# Read Caps
stopping_areas = dict(SyDB.Get_Stopping_Areas())
cod_area = dict(SyDB.Get_COD_Areas_With_Items())
platforms = dict(SyDB.Get_Platforms_With_Items())
stablings = dict(SyDB.Get_Stabling_Location_With_Items())
coupling_areas = dict(SyDB.Get_Coupling_Uncoupling_Area_With_Items())
wasing_zones = dict(SyDB.Get_Washing_Zone_With_Items())
transfer_tracks = dict(SyDB.Get_Transfer_Tracks_With_Items())
isolation_areas = dict(SyDB.Get_Isolation_Areas_With_Items())

# Author : Saleem Javed
# Updated 23 May 2017
# Caps Used : Sydb Nodes Platforms,Change_Of_Direction_Areas,Stablings_Location,Isolation_Areas
#                        Coupling_Uncoupling_Areas,Washing_Zones,Transfer_Tracks,
# Constant used :  None
# GFPD : 0962_AP51
###================================================================================================

# Create report file
global_test_results = list()
wbReport = workbook.Workbook()
wsRpt = wbReport.active
wsRpt.title = "Test_Results"
rwCount = 1
Utility.WriteToWorkSheet(
    wsRpt, rwCount,
    ["Stopping_Area", "Original_Area_Name", "Original_Area_SSP_Ids", "Result"])
rwCount = rwCount + 1

# Read Caps
stopping_areas = dict(SyDB.Get_Stopping_Areas())
cod_area = dict(SyDB.Get_COD_Areas_With_Items())
platforms = dict(SyDB.Get_Platforms_With_Items())
stablings = dict(SyDB.Get_Stabling_Location_With_Items())
coupling_areas = dict(SyDB.Get_Coupling_Uncoupling_Area_With_Items())
wasing_zones = dict(SyDB.Get_Washing_Zone_With_Items())
transfer_tracks = dict(SyDB.Get_Transfer_Tracks_With_Items())
isolation_areas = dict(SyDB.Get_Isolation_Areas_With_Items())


def GetOriginalSSPId(OriginalArea: dict, ID):
### =========RULE_STOPPING_AREA_0008===============================================================
# Author : Saleem Javed
# Updated 23 May 2017
# Caps Used : Sydb Nodes Platforms,Change_Of_Direction_Areas,Stablings_Location,Isolation_Areas
#                        Coupling_Uncoupling_Areas,Washing_Zones,Transfer_Tracks,
# Constant used :  None 
# GFPD : 0962_AR
###================================================================================================

# Create report file
global_test_results = list()
wbReport = workbook.Workbook()
wsRpt=wbReport.active
wsRpt.title = "Test_Results"
rwCount = 1
Utility.WriteToWorkSheet(wsRpt,rwCount,["Stopping_Area", "Original_Area_Names", "Original_Area_Tracks", "Original_Area_Kp_Begin", "Original_Area_Kp_End","Result"])
rwCount = rwCount+1

# Read Caps
stopping_areas = dict(SyDB.Get_Stopping_Areas())
cod_area = dict(SyDB.Get_COD_Areas_With_Items())
platforms = dict(SyDB.Get_Platforms_With_Items())
stablings = dict(SyDB.Get_Stabling_Location_With_Items())
coupling_areas = dict(SyDB.Get_Coupling_Uncoupling_Area_With_Items())
wasing_zones = dict(SyDB.Get_Washing_Zone_With_Items())
transfer_tracks = dict(SyDB.Get_Transfer_Tracks_With_Items())
isolation_areas = dict(SyDB.Get_Isolation_Areas_With_Items())

def GetOriginalAreaItems(OriginalArea:dict, ID):
    try:
        for name, items in OriginalArea.items():
Exemplo n.º 16
0
ssp_trfc = ssp_cap['Train_Formation_Characteristics_ID_List']
ssp_dir = ssp_cap['Direction']
ssp_kp = Utility.GetKpValue(ssp_cap['KpValue'],
                            ssp_cap['KpCorrected_Trolley_Value'])

trfc_name = trfc_cap['Name']
trfc_form_length = trfc_cap['Formation_Length']

# Create report file
global_test_results = list()
wbReport = workbook.Workbook()
wsRpt = wbReport.active
wsRpt.title = "Test_Results"
rwCount = 1
Utility.WriteToWorkSheet(wsRpt, rwCount, [
    "Stabling", "Track", "Kp_Begin", "Kp_End", "SSP", "Direction",
    "Stabling_Length", "Train", "Train_Length", "Result"
])
rwCount = rwCount + 1

stl_stl_next = dict()
stl_stl_prev = dict()
for i in range(len(stl_id)):
    for j in range(len(stl_id)):
        if stl_track[i] == stl_track[j]:
            if int(stl_kp_end[i]) == int(stl_kp_begin[j]):
                stl_stl_next[i] = j
                stl_stl_prev[j] = i
                break


def GetEndofStablingIncreasing(StablingIndex: int):