Beispiel #1
0
    def draw(self, context):
        layout = self.layout
        metadata_index = context.scene.data_list_index
        metadata_list = context.scene.data_list
        # valid index is ensured by invoke method
        metadata = metadata_list[metadata_index]
        col = layout.column(align=True)
        col.enabled = False
        col.label(text=f'Name: {metadata.name}')
        col.label(text=f'Filepath: {metadata.filepath}')
        col.label(text=f'Info: {metadata.data_info}')

        row = layout.row(align=True)
        row.prop(self, 'should_scroll_left', text='', icon='TRIA_LEFT')
        row.prop(self, 'max_displayed_cols', text='Displayed Columns')
        row.prop(self, 'should_scroll_right', text='', icon='TRIA_RIGHT')

        data_manager = DataManager()
        # TODO: not super fast, but gets the job done
        parsed_data = data_manager.get_parsed_data()
        self.handle_property_input(parsed_data)

        row = layout.row()
        start_index = self.start_col_index
        max_index = start_index + self.max_displayed_cols - 1
        for i in range(len(parsed_data[1])):
            if i < start_index or i > max_index:
                continue
            col = row.column()
            for j in range(len(parsed_data)):
                col.label(text=str(parsed_data[j][i]))
Beispiel #2
0
    def execute(self, context):
        data_manager = DataManager()
        line_n = data_manager.load_data(self.filepath)

        report_type = {'INFO'}
        if line_n == 0:
            report_type = {'WARNING'}
        self.report(report_type, f'File: {self.filepath}, loaded {line_n} lines!')
        return {'FINISHED'}
Beispiel #3
0
    def __init__(self):
        self.container_object = None
        self.labels = []
        self.dm = DataManager()
        self.prev_anim_setting = False
        if hasattr(self, 'dimensions'):
            self.dimensions = str(self.dm.dimensions)

        if hasattr(self, 'data_type'):
            self.data_type = '0' if self.dm.predicted_data_type == DataType.Numerical else '1'

        self.chart_id = OBJECT_OT_GenericChart.chart_id
        OBJECT_OT_GenericChart.chart_id += 1
Beispiel #4
0
    def poll(cls, context):
        for mod in ['scipy', 'numpy']:
            if not env_utils.is_module_installed(mod):
                return False

        return DataManager().is_type(DataType.Numerical, [3], only_3d=True)
Beispiel #5
0
 def poll(cls, context):
     dm = DataManager()
     return dm.is_type(DataType.Numerical, 3) and dm.has_compatible_subtype(
         [DataSubtype.XYW, DataSubtype.XYZW])
Beispiel #6
0
 def poll(cls, context):
     dm = DataManager()
     return dm.is_type(DataType.Numerical, [2]) or dm.is_type(DataType.Categorical, [2])
Beispiel #7
0
 def poll(cls, context):
     dm = DataManager()
     return not dm.has_labels and dm.is_type(DataType.Categorical, [2])
Beispiel #8
0
class DV_AxisPropertyGroup(bpy.types.PropertyGroup):
    '''Axis Settings, used with AxisFactory'''
    def range_updated(self, context):
        if self.x_range[0] == self.x_range[1]:
            self.x_range[1] += 1.0
        if self.y_range[0] == self.y_range[1]:
            self.y_range[1] += 1.0
        if self.z_range[0] == self.z_range[1]:
            self.z_range += 1.0

    create: bpy.props.BoolProperty(
        name='Create Axis Object',
        default=True,
    )

    auto_steps: bpy.props.BoolProperty(
        name='Automatic Steps',
        default=True,
        description='Automatically calculates stepsize to display 10 marks')

    x_step: bpy.props.FloatProperty(
        name='Step of x axis',
        default=1.0,
    )

    x_range: bpy.props.FloatVectorProperty(
        name='Range of x axis',
        size=2,
        update=range_updated,
        default=DataManager().get_range('x'))

    y_step: bpy.props.FloatProperty(
        name='Step of y axis',
        default=1.0,
    )

    y_range: bpy.props.FloatVectorProperty(
        name='Range of y axis',
        size=2,
        update=range_updated,
        default=DataManager().get_range('y'))

    z_range: bpy.props.FloatVectorProperty(
        name='Range of y axis',
        size=2,
        update=range_updated,
        default=DataManager().get_range('z'),
    )

    z_step: bpy.props.FloatProperty(
        name='Step of z axis',
        default=1.0,
    )

    z_position: bpy.props.EnumProperty(
        name='Z Axis Pos',
        items=(
            ('FRONT', 'Front', 'Left front corner'),
            ('BACK', 'Back', 'Left back corner'),
            ('RIGHT', 'Right', 'Right front corner'),
        ),
        default='FRONT')

    thickness: bpy.props.FloatProperty(
        name='Thickness',
        min=0.001,
        max=0.02,
        default=0.005,
        description='How thick is the axis object')

    tick_mark_height: bpy.props.FloatProperty(
        name='Tick Mark Height',
        default=0.015,
        min=0.001,
        max=0.02,
        description='Thickness of axis mark objects')

    padding: bpy.props.FloatProperty(
        name='Padding',
        default=0.1,
        min=0,
        description='Axis distance from chart origin')

    text_size: bpy.props.FloatProperty(name='Text size', default=0.05)

    number_format: bpy.props.EnumProperty(name='Num format',
                                          items=(('0', 'Decimal', '123.456'),
                                                 ('1', 'Scientific',
                                                  '1.23e+05')))

    decimal_places: bpy.props.IntProperty(name='Decimal places',
                                          default=2,
                                          min=0)
Beispiel #9
0
 def poll(cls, context):
     return DataManager().is_type(DataType.Numerical, [2, 3])
Beispiel #10
0
 def poll(cls, context):
     return modules_available and DataManager().is_type(DataType.Numerical, [3])