def add_train_bei(self): para = self.parameter l3 = Line(name_base='线路3', sec_group=self.section_group3, parameter=self.parameter) self.l3 = l3 l4 = Line(name_base='线路4', sec_group=self.section_group4, parameter=self.parameter, train=[self.train1]) self.l4 = l4 self.set_rail_para(line=l3, z_trk=para['主串钢轨阻抗'], rd=para['主串道床电阻']) self.set_rail_para(line=l4, z_trk=para['被串钢轨阻抗'], rd=para['被串道床电阻']) self.lg = LineGroup(self.l3, self.l4, name_base='线路组') self.lg.special_point = self.parameter['special_point'] self.lg.refresh()
def add_train(self): para = self.parameter self.train1 = Train(name_base='列车1', posi=0, parameter=para) l3 = Line(name_base='线路3', sec_group=self.section_group3, parameter=self.parameter, train=[self.train1]) self.l3 = l3 self.set_rail_para(line=l3, z_trk=para['主串钢轨阻抗'], rd=para['主串道床电阻']) self.lg = LineGroup(self.l3, name_base='线路组') self.lg.special_point = self.parameter['special_point'] self.lg.refresh()
def __init__(self, parameter): super().__init__(parameter) self.parameter = para = parameter # 轨道电路初始化 send_level = para['send_level'] m_frqs = generate_frqs(Freq(para['freq_主']), 3) sg3 = SectionGroup(name_base='地面', posi=para['offset'], m_num=1, m_frqs=m_frqs, m_lens=[para['length']] * 3, j_lens=[0] * 4, m_typs=['2000A'] * 3, c_nums=[para['主串电容数']], sr_mods=[para['sr_mod_主']] * 3, send_lvs=[send_level] * 3, parameter=parameter) flg = para['pwr_v_flg'] if para['sr_mod_主'] == '左发': sg3['区段1']['左调谐单元'].set_power_voltage(flg) elif para['sr_mod_主'] == '右发': sg3['区段1']['右调谐单元'].set_power_voltage(flg) self.section_group3 = sg3 self.change_c_value() self.pop_c() self.check_fault() self.l3 = l3 = Line(name_base='线路3', sec_group=sg3, parameter=parameter) self.set_rail_para(line=l3, z_trk=para['主串钢轨阻抗'], rd=para['主串道床电阻']) self.lg = LineGroup(l3, name_base='线路组') self.lg.special_point = para['special_point'] self.lg.refresh()
def __init__(self, parameter): # super().__init__(turnout_list, parameter) self.parameter = para = parameter self.train1 = Train(name_base='列车1', posi=0, parameter=parameter) self.train2 = Train(name_base='列车2', posi=0, parameter=parameter) # self.train1['分路电阻1'].z = 1000000 # self.train2['分路电阻1'].z = 1000000 # 轨道电路初始化 send_level = para['send_level'] m_frqs = generate_frqs(Freq(para['freq_主']), 1) sg3 = SectionGroup(name_base='地面', posi=para['offset_zhu'], m_num=1, m_frqs=m_frqs, m_lens=[para['主串区段长度']], j_lens=[0, 0], m_typs=['2000A'], c_nums=[para['主串电容数']], sr_mods=[para['sr_mod_主']], send_lvs=[send_level], parameter=parameter) flg = para['pwr_v_flg'] if para['sr_mod_主'] == '左发': sg3['区段1']['左调谐单元'].set_power_voltage(flg) elif para['sr_mod_主'] == '右发': sg3['区段1']['右调谐单元'].set_power_voltage(flg) m_frqs = generate_frqs(Freq(para['freq_被']), 1) sg4 = SectionGroup( name_base='地面', posi=para['offset_bei'], m_num=1, m_frqs=m_frqs, m_lens=[para['被串区段长度']], # j_lens=[0, 0], # m_typs=['2000A_25Hz_Coding'], j_lens=[0, 0], m_typs=['2000A'], c_nums=[para['被串电容数']], sr_mods=[para['sr_mod_被']], send_lvs=[send_level], parameter=parameter) # m_frqs = generate_frqs(Freq(para['freq_被']), 2) # sg4 = SectionGroup(name_base='地面', posi=para['offset_bei'], m_num=2, # m_frqs=m_frqs, # m_lens=[560, 830], # j_lens=[29, 29, 29], # m_typs=['2000A']*2, # c_nums=[6, 9], # sr_mods=[para['sr_mod_被']]*2, # send_lvs=[send_level]*2, # parameter=parameter) # partent = sg3['区段1'] # ele = JumperWire(parent_ins=partent, # name_base='跳线', # posi=para['主串区段长度']) # partent.add_child('跳线', ele) # ele.set_posi_abs(0) # self.jumper = ele self.section_group3 = sg3 self.section_group4 = sg4 self.change_c_value() # self.pop_c() self.l3 = l3 = Line(name_base='线路3', sec_group=sg3, parameter=parameter) self.l4 = l4 = Line(name_base='线路4', sec_group=sg4, parameter=parameter) self.set_rail_para(line=l3, z_trk=para['Trk_z'], rd=para['Trk_z']) self.set_rail_para(line=l4, z_trk=para['Trk_z'], rd=para['Trk_z']) self.lg = LineGroup(l3, l4, name_base='线路组') self.lg.special_point = para['special_point'] self.lg.refresh()
def __init__(self, parameter): self.parameter = para = parameter self.train1 = Train(name_base='列车1', posi=0, parameter=parameter) self.train2 = Train(name_base='列车2', posi=0, parameter=parameter) # self.train3 = Train(name_base='列车3', posi=0, parameter=parameter) # self.train4 = Train(name_base='列车4', posi=0, parameter=parameter) # self.train2['分路电阻1'].z = 1000000 # 轨道电路初始化 send_level = para['send_level'] m_frqs = generate_frqs(Freq(para['freq_主']), 3) m_lens = [para['主串区段长度']] * 3 c_nums = get_c_nums(m_frqs, m_lens) offset = para['offset'] + m_lens[0] sg3 = SectionGroup(name_base='地面', posi=offset, m_num=1, m_frqs=m_frqs, m_lens=m_lens, j_lens=[29] * 4, m_typs=['2000A'] * 3, c_nums=c_nums, sr_mods=[para['sr_mod_主']] * 3, send_lvs=[send_level] * 3, parameter=parameter) flg = para['pwr_v_flg'] if para['sr_mod_主'] == '左发': sg3['区段1']['左调谐单元'].set_power_voltage(flg) elif para['sr_mod_主'] == '右发': sg3['区段1']['右调谐单元'].set_power_voltage(flg) # sg3['区段1']['左调谐单元'].set_power_voltage() m_frqs = generate_frqs(Freq(para['freq_被']), 3, flip_flag=True) m_lens = [para['被串区段长度']] * 3 c_nums = get_c_nums(m_frqs, m_lens) sg4 = SectionGroup(name_base='地面', posi=0, m_num=3, m_frqs=m_frqs, m_lens=m_lens, j_lens=[29] * 4, m_typs=['2000A'] * 3, c_nums=c_nums, sr_mods=[para['sr_mod_被']] * 3, send_lvs=[send_level] * 3, parameter=parameter) partent = sg3['区段1'] ele = JumperWire(parent_ins=partent, name_base='跳线', posi=para['主串区段长度']) partent.add_child('跳线', ele) ele.set_posi_abs(0) self.jumper = ele # partent = sg3['区段2'] # ele = JumperWire(parent_ins=partent, # name_base='跳线', # posi=0) # partent.add_child('跳线', ele) # ele.set_posi_abs(0) # jumper2 = ele # config_jumpergroup(jumper1, jumper2) self.section_group3 = sg3 self.section_group4 = sg4 # self.check_C2TB() # self.change_c_value() # self.pop_c() # self.config_c_posi() # self.check_fault() # self.change_cable_length() # self.change_r_shunt() # sg3['区段1'].element.pop('TB2') # sg3['区段1'].element.pop('左调谐单元') # sg3['区段1']['TB2'].z = para['标准开路阻抗'] self.l3 = l3 = Line(name_base='线路3', sec_group=sg3, parameter=parameter) self.l4 = l4 = Line(name_base='线路4', sec_group=sg4, parameter=parameter) self.set_rail_para(line=l3, z_trk=para['主串钢轨阻抗'], rd=para['主串道床电阻']) self.set_rail_para(line=l4, z_trk=para['被串钢轨阻抗'], rd=para['被串道床电阻']) self.lg = LineGroup(l3, l4, name_base='线路组') self.lg.special_point = para['special_point'] self.lg.refresh() pass
def __init__(self, parameter): # super().__init__(turnout_list, parameter) self.parameter = para = parameter self.train1 = Train(name_base='列车1', posi=0, parameter=parameter) self.train2 = Train(name_base='列车2', posi=0, parameter=parameter) # 轨道电路初始化 send_level = para['send_level'] m_frqs = generate_frqs(Freq(para['freq_主']), 3) sg3 = SectionGroup(name_base='地面', posi=para['offset'], m_num=1, m_frqs=m_frqs, m_lens=[para['主串区段长度']] * 3, j_lens=[0] * 4, m_typs=['2000A_YPMC'] * 3, c_nums=[para['主串电容数']], sr_mods=[para['sr_mod_主']] * 3, send_lvs=[send_level] * 3, parameter=parameter) flg = para['pwr_v_flg'] if para['sr_mod_主'] == '左发': sg3['区段1']['左调谐单元'].set_power_voltage(flg) elif para['sr_mod_主'] == '右发': sg3['区段1']['右调谐单元'].set_power_voltage(flg) m_frqs = generate_frqs(Freq(para['freq_被']), 3) sg4 = SectionGroup(name_base='地面', posi=0, m_num=1, m_frqs=m_frqs, m_lens=[para['被串区段长度']] * 3, j_lens=[0] * 4, m_typs=['2000A_YPMC'] * 3, c_nums=[para['被串电容数']], sr_mods=[para['sr_mod_被']] * 3, send_lvs=[send_level] * 3, parameter=parameter) partent = sg3['区段1'] ele = JumperWire(parent_ins=partent, name_base='跳线', posi=para['主串区段长度']) partent.add_child('跳线', ele) ele.set_posi_abs(0) self.jumper = ele self.section_group3 = sg3 self.section_group4 = sg4 self.change_c_value() # self.pop_c() self.change_EL_n() self.change_cable_length() self.change_r_shunt() self.l3 = l3 = Line(name_base='线路3', sec_group=sg3, parameter=parameter) self.l4 = l4 = Line(name_base='线路4', sec_group=sg4, parameter=parameter) self.set_rail_para(line=l3, z_trk=para['主串钢轨阻抗'], rd=para['主串道床电阻']) self.set_rail_para(line=l4, z_trk=para['被串钢轨阻抗'], rd=para['被串道床电阻']) self.lg = LineGroup(l3, l4, name_base='线路组') self.lg.special_point = para['special_point'] self.lg.refresh()
def __init__(self, parameter): # super().__init__(turnout_list, parameter) self.parameter = para = parameter self.train1 = Train(name_base='列车1', posi=0, parameter=parameter) self.train2 = Train(name_base='列车2', posi=0, parameter=parameter) # self.train2['分路电阻1'].z = 1000000 # 轨道电路初始化 send_level = para['send_level'] m_frqs = generate_frqs(Freq(para['freq_主']), 1) sg3 = SectionGroup(name_base='地面', posi=para['offset'], m_num=1, m_frqs=m_frqs, m_lens=[para['主串区段长度']], j_lens=[29, 0], m_typs=['2000A'], c_nums=[para['主串电容数']], sr_mods=[para['sr_mod_主']], send_lvs=[send_level], parameter=parameter) flg = para['pwr_v_flg'] if para['sr_mod_主'] == '左发': sg3['区段1']['左调谐单元'].set_power_voltage(flg) elif para['sr_mod_主'] == '右发': sg3['区段1']['右调谐单元'].set_power_voltage(flg) m_frqs = generate_frqs(Freq(para['freq_被']), 1) sg4 = SectionGroup(name_base='地面', posi=0, m_num=1, m_frqs=m_frqs, m_lens=[para['被串区段长度']], j_lens=[29, 0], m_typs=['2000A'], c_nums=[para['被串电容数']], sr_mods=[para['sr_mod_被']], send_lvs=[send_level], parameter=parameter) self.section_group3 = sg3 self.section_group4 = sg4 self.change_c_value() self.pop_c() self.check_fault() self.l3 = l3 = Line(name_base='线路3', sec_group=sg3, parameter=parameter) self.l4 = l4 = Line(name_base='线路4', sec_group=sg4, parameter=parameter) self.set_rail_para(line=l3, z_trk=para['主串钢轨阻抗'], rd=para['主串道床电阻']) self.set_rail_para(line=l4, z_trk=para['被串钢轨阻抗'], rd=para['被串道床电阻']) self.lg = LineGroup(l3, l4, name_base='线路组') self.lg.special_point = para['special_point'] self.lg.refresh()
def __init__(self, parameter): # super().__init__(turnout_list, parameter) self.parameter = para = parameter self.train1 = Train(name_base='列车1', posi=0, parameter=parameter) self.train2 = Train(name_base='列车2', posi=0, parameter=parameter) # 轨道电路初始化 send_level = para['send_level'] m_frqs = generate_frqs(Freq(para['freq_主']), 3) sg3 = SectionGroup(name_base='地面', posi=para['offset'], m_num=1, m_frqs=m_frqs, m_lens=[para['主串区段长度']] * 3, j_lens=[0] * 4, m_typs=['2000A_25Hz_Coding'] * 3, c_nums=[para['主串电容数']], sr_mods=[para['sr_mod_主']] * 3, send_lvs=[send_level] * 3, parameter=parameter) flg = para['pwr_v_flg'] if para['sr_mod_主'] == '左发': sg3['区段1']['左调谐单元'].set_power_voltage(flg) elif para['sr_mod_主'] == '右发': sg3['区段1']['右调谐单元'].set_power_voltage(flg) m_frqs = generate_frqs(Freq(para['freq_被']), 3) sg4 = SectionGroup(name_base='地面', posi=0, m_num=1, m_frqs=m_frqs, m_lens=[para['被串区段长度']] * 3, j_lens=[0] * 4, m_typs=['2000A_25Hz_Coding'] * 3, c_nums=[para['被串电容数']], sr_mods=[para['sr_mod_被']] * 3, send_lvs=[send_level] * 3, parameter=parameter) # sg3['区段1'].element.pop('左调谐单元') # sg3['区段1'].element.pop('右调谐单元') # sg4['区段1'].element.pop('左调谐单元') # sg4['区段1'].element.pop('右调谐单元') # partent = sg3['区段1'] # ele = ZPW2000A_ZN_25Hz_Coding(parent_ins=partent, # name_base='25Hz叠加电码化发送器', # posi_flag='右',) # partent.add_child('25Hz叠加电码化发送器', ele) # ele.set_posi_abs(0) # # ele = ZOutside(parent_ins=partent, # name_base='接收端阻抗', # posi=0, # z=para['z_EL_25Hz']) # partent.add_child('接收端阻抗', ele) # ele.set_posi_abs(0) # # partent = sg4['区段1'] # ele = ZOutside(parent_ins=partent, # name_base='接收端阻抗', # posi=0, # z=para['z_EL_25Hz']) # partent.add_child('接收端阻抗', ele) # ele.set_posi_abs(0) # # ele = ZOutside(parent_ins=partent, # name_base='发送端阻抗', # posi=para['被串区段长度'], # z=para['z_EL_25Hz']) # partent.add_child('发送端阻抗', ele) # ele.set_posi_abs(0) # for ttt in [1,3,5,7,9,11]: # for ttt in [2,4,6,8,10]: # str_temp = 'C' + str(ttt) # sg3['区段1'].element.pop(str_temp) # sg4['区段1'].element.pop(str_temp) partent = sg3['区段1'] ele = JumperWire(parent_ins=partent, name_base='跳线', posi=para['主串区段长度']) partent.add_child('跳线', ele) ele.set_posi_abs(0) self.jumper = ele self.section_group3 = sg3 self.section_group4 = sg4 self.change_c_value() self.pop_c() self.l3 = l3 = Line(name_base='线路3', sec_group=sg3, parameter=parameter) self.l4 = l4 = Line(name_base='线路4', sec_group=sg4, parameter=parameter) self.set_rail_para(line=l3, z_trk=para['主串钢轨阻抗'], rd=para['主串道床电阻']) self.set_rail_para(line=l4, z_trk=para['被串钢轨阻抗'], rd=para['被串道床电阻']) self.lg = LineGroup(l3, l4, name_base='线路组') self.lg.special_point = para['special_point'] self.lg.refresh()
parameter=para) sg2 = SectionGroup(name_base='地面', posi=0, m_num=2, freq1=1700, m_length=[480, 200, 320], j_length=[29, 29, 29, 29], m_type=['2000A', '2000A', '2000A'], c_num=[8, 6, 5], parameter=para) train1 = Train(name_base='列车1', posi_abs=0, parameter=para) # 生成线路 l1 = Line(name_base='线路1', sec_group=sg1, train=train1, parameter=para) l2 = Line(name_base='线路2', sec_group=sg2, parameter=para) lg = LineGroup(l1, name_base='线路组') # 建立模型 model = MainModel(lg) show_ele('111') a = 1 pass # output = [] # for i in range(0, 600, 1): # set_posi_abs(train1, i) # l1.set_sub_rail(ele_all=ele_all) # # l2.set_sub_rail(ele_all=ele_all) # # 生成矩阵 # # m1 = Matrix(l1, l2, freq=FREQ)