예제 #1
0
    def plot_forces(self):

        if self.header_list is None:
            return

        self.checkboxes = []
        cb_container = widgets.VBox()
        display(cb_container)
        for h in self.header_list:
            if h not in self.residual_list and h not in [
                    'RealTimeStep', 'Cycle'
            ]:
                self.checkboxes.append(
                    widgets.Checkbox(description=h, value=False, width=90))

        row_list = []
        for i in range(0, len(self.checkboxes), 3):
            row = widgets.HBox()
            row.children = self.checkboxes[i:i + 3]
            row_list.append(row)

        cb_container.children = [i for i in row_list]

        button = widgets.Button(description="Update plots")
        button.on_click(self.plot_data)
        display(button)
예제 #2
0
def autoscroll(threshhold):
    if threshhold == 0:  # alway scroll !not good
        javastring = """
        IPython.OutputArea.prototype._should_scroll = function(lines) {
            return true;
        }
        """
    elif threshhold == -1:  # never scroll !not good
        javastring = """
        IPython.OutputArea.prototype._should_scroll = function(lines) {
            return false;
        }
        """
    else:
        javastring = "IPython.OutputArea.auto_scroll_threshold = " + str(
            threshhold)
    display(Javascript(javastring))
예제 #3
0
    def plot_test(self, report_file):

        self.resildual_checkboxes = []
        cb_container = widgets.VBox()
        display(cb_container)
        for h in self.header_list:
            if h not in self.residual_list and h not in [
                    'RealTimeStep', 'Cycle'
            ]:
                self.checkboxes.append(
                    widgets.Checkbox(description=h, value=False, width=90))

        row_list = []
        for i in range(0, len(self.checkboxes), 3):
            row = widgets.HBox()
            row.children = self.checkboxes[i:i + 3]
            row_list.append(row)

        cb_container.children = [i for i in row_list]
예제 #4
0
    def plot_forces(self, mean=100):

        # Need to disable autoscroll
        # autoscroll(-1)

        self.rolling_avg = mean

        if self.header_list is None:
            return

        if self.cb_container is None:
            self.out = widgets.Output()
            self.checkboxes = []
            self.cb_container = widgets.VBox()
            for h in self.header_list:
                if h not in self.residual_list and h not in [
                        "RealTimeStep", "Cycle"
                ]:
                    self.checkboxes.append(
                        widgets.Checkbox(description=h, value=False, width=90))

            row_list = []
            for i in range(0, len(self.checkboxes), 3):
                row = widgets.HBox()
                row.children = self.checkboxes[i:i + 3]
                row_list.append(row)

            self.cb_container.children = [i for i in row_list]

            self.rolling = widgets.IntSlider(
                value=self.rolling_avg,
                min=1,
                max=1000,
                step=1,
                description="Rolling Average:",
            )

            self.button = widgets.Button(description="Update plots")
            self.button.on_click(self.plot_data)

        display(self.out)
        display(self.cb_container)
        display(self.rolling)
        display(self.button)