Пример #1
0
 def table(self, drs: DRS) -> DRS:
     """
     Given a DRS, it configures it to the table view
     :param drs: the DRS to configure
     :return: the same DRS in the table mode
     """
     drs.set_table_mode()
     return drs
Пример #2
0
    def _hit_to_drs(self, hit: Hit, table_mode=False) -> DRS:
        """
        Given a Hit, return a DRS. If in table mode, the resulting DRS will
        contain Hits representing that table.
        :param hit: Hit
        :param table_mode: if the Hit represents an entire table
        :return: DRS
        """
        drs = None
        if table_mode:
            table = hit.source_name
            hits = self._network.get_hits_from_table(table)
            drs = DRS([x for x in hits], Operation(OP.TABLE, params=[hit]))
            drs.set_table_mode()
        else:
            drs = DRS([hit], Operation(OP.ORIGIN))

        return drs