test_network_map.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:RRPam-WDS 作者: asselapathirana 项目源码 文件源码
def clicking_close_to_a_link_will_select_it_on_the_plot(self):

        pdds, nwm = draw_a_network(self.aw, network=ex.networks[0])
        # select a link
        l = pdds.links[3]
        pos = [(l.start.x + l.end.x) / 2.0, (l.start.y, l.end.y) / 2.0]
        curve = [x for x in nwm.get_plot().get_items() if x.title().text() == l.id][0]
        plot = curve.plot()
        ax = curve.xAxis()
        ay = curve.yAxis()
        px = plot.transform(ax, pos[0])
        py = plot.transform(ay, pos[1])
        logger = logging.getLogger()
        logger.info(curve.title().text())
        QTest.mouseClick(plot, Qt.RightButton, pos=QPoint(px, py), delay=10.)
        logger = logging.getLogger()
        logger.info(str(plot.get_selected_items()))
        logger = logging.getLogger()
        logger.info((nwm.get_plot().get_selected_items()))
        # this test does not work yet.
        # todo: fix this test to work.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号