-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/Kalleculated/FFT-Analysator
- Loading branch information
Showing
7 changed files
with
93 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import panel as pn | ||
import numpy as np | ||
from tkinter import Tk, filedialog | ||
import os | ||
class FileExporter: | ||
def __init__(self): | ||
self.file_input_button = pn.widgets.Button | ||
self._component = self.file_input_button(name='\U0001F4BE ' 'Save and Export', margin=(10, 0, 10, 10), width=150) | ||
self.dir_path = None | ||
|
||
def select_directory(self, event, data, chn1, chn2, method, ext, window, overlap): | ||
root = Tk() | ||
root.withdraw() | ||
root.call('wm', 'attributes', '.', '-topmost', True) | ||
dir = filedialog.askdirectory(initialdir=os.getcwd()) | ||
method = method.replace(" ", "") | ||
if dir: | ||
self.dir_path = dir | ||
file_name = str(dir) + "/" + str(method) + "_" + str(chn1) + "_" + str(chn2) + "_" + str(window) + "_" + str(overlap) | ||
print(file_name) | ||
if ext == "Numpy Array": | ||
np.save(file_name, data) | ||
if ext == "Binary": | ||
data.astype(np.int64).tofile(file_name) | ||
else: | ||
self.dir_path = None | ||
root.destroy() | ||
|
||
@property | ||
def component(self): | ||
return self._component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import panel as pn | ||
|
||
class ExporterSelector: | ||
def __init__(self): | ||
self.export_selector = pn.widgets.Select | ||
self.options = ['Numpy Array', 'Binary'] | ||
self._component = self.export_selector(name='Choose export extension:', options=self.options, width=300, | ||
value='Numpy Array', disabled=False) | ||
@property | ||
def component(self): | ||
return self._component |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import panel as pn | ||
|
||
|
||
class OverlapSelector: | ||
""" | ||
A class used to represent an Overlap Selector widget. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters