From 1caab5a9ee62e046bbf38247d7fd2c4f4be6a234 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Wed, 7 Oct 2020 11:24:00 -0400 Subject: [PATCH] Added the capability to push Q to clipboard --- bioviz/__init__.py | 8 ++++++++ environment.yml | 1 + 2 files changed, 9 insertions(+) diff --git a/bioviz/__init__.py b/bioviz/__init__.py index c395243..491f4f8 100644 --- a/bioviz/__init__.py +++ b/bioviz/__init__.py @@ -6,6 +6,7 @@ import numpy as np import scipy import biorbd +import pandas if biorbd.currentLinearAlgebraBackend() == 1: import casadi @@ -369,6 +370,9 @@ def reset_q(self): # Reset also muscle analyses graphs self.__update_muscle_analyses_graphs(False, False, False, False) + def copy_q_to_clipboard(self): + pandas.DataFrame(self.Q[np.newaxis, :]).to_clipboard(sep=',', index=False, header=False) + def set_q(self, Q, refresh_window=True): """ Manually update @@ -507,6 +511,10 @@ def add_options_panel(self): reset_push_button.setPalette(self.palette_active) reset_push_button.released.connect(self.reset_q) button_layout.addWidget(reset_push_button) + copyq_push_button = QPushButton("Copy Q to clipboard") + copyq_push_button.setPalette(self.palette_active) + copyq_push_button.released.connect(self.copy_q_to_clipboard) + button_layout.addWidget(copyq_push_button) # Add the radio button for analyses option_analyses_group = QGroupBox() diff --git a/environment.yml b/environment.yml index 1b35999..3bc8cd3 100644 --- a/environment.yml +++ b/environment.yml @@ -7,6 +7,7 @@ dependencies: - pyomeca - vtk - pyqt + - pandas - eigen - rbdl - biorbd