Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI v6.0.0-beta.1 #1197

Merged
merged 4 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OpenBCI_GUI/OpenBCI_GUI.pde
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
// Global Variables & Instances
//------------------------------------------------------------------------
//Used to check GUI version in TopNav.pde and displayed on the splash screen on startup
String localGUIVersionString = "v6.0.0-beta.0";
String localGUIVersionString = "v6.0.0-beta.1";
String localGUIVersionDate = "September 2023";
String guiLatestVersionGithubAPI = "https://api.github.com/repos/OpenBCI/OpenBCI_GUI/releases/latest";
String guiLatestReleaseLocation = "https://github.com/OpenBCI/OpenBCI_GUI/releases/latest";
Expand Down
6 changes: 2 additions & 4 deletions OpenBCI_GUI/W_Marker.pde
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class W_Marker extends Widget {
private Textfield markerReceivePortTextfield;
private String markerReceiveIP = "127.0.0.1";
private int markerReceivePort = 12350;
private final int MARKER_RECEIVE_TEXTFIELD_WIDTH = 100;
private final int MARKER_RECEIVE_TEXTFIELD_HEIGHT = 20;
private final int MARKER_RECEIVE_TEXTFIELD_WIDTH = 108;
private final int MARKER_RECEIVE_TEXTFIELD_HEIGHT = 22;

private hypermedia.net.UDP udpReceiver;

Expand Down Expand Up @@ -144,11 +144,9 @@ class W_Marker extends Widget {

RectDimensions ipTextfieldPosition = markerUIGrid.getCellDims(3, 1);
markerReceiveIPTextfield.setPosition(ipTextfieldPosition.x, ipTextfieldPosition.y + HALF_CELL_PADDING);
markerReceiveIPTextfield.setSize(ipTextfieldPosition.w, ipTextfieldPosition.h - CELL_PADDING);

RectDimensions portTextfieldPosition = markerUIGrid.getCellDims(3, 3);
markerReceivePortTextfield.setPosition(portTextfieldPosition.x, portTextfieldPosition.y + HALF_CELL_PADDING);
markerReceivePortTextfield.setSize(portTextfieldPosition.w, portTextfieldPosition.h - CELL_PADDING);
}

private void createMarkerButtons() {
Expand Down
59 changes: 59 additions & 0 deletions tools/graph_gui_downloads.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import requests
import matplotlib.pyplot as plt
from datetime import datetime

# Define the GitHub API URL for the OpenBCI releases
api_url = "https://api.github.com/repos/OpenBCI/OpenBCI_GUI/releases"

# Send a GET request to the API
response = requests.get(api_url)

# Check if the request was successful
if response.status_code != 200:
print(f"Failed to fetch data. Status code: {response.status_code}")
exit()

# Parse the JSON data
data = response.json()

# Initialize dictionaries to store download counts for each platform
download_count_mac = {}
download_count_linux = {}
download_count_windows = {}

# Extract download counts over time for each platform
for release in data:
assets = release.get("assets", [])
release_date = datetime.strptime(release["published_at"], "%Y-%m-%dT%H:%M:%SZ").date()

for asset in assets:
if "mac" in asset["name"].lower():
download_count_mac[release_date] = download_count_mac.get(release_date, 0) + asset["download_count"]
elif "linux" in asset["name"].lower():
download_count_linux[release_date] = download_count_linux.get(release_date, 0) + asset["download_count"]
elif "win" in asset["name"].lower():
download_count_windows[release_date] = download_count_windows.get(release_date, 0) + asset["download_count"]

# Extract dates and download counts for each platform
dates_mac, counts_mac = zip(*sorted(download_count_mac.items()))
dates_linux, counts_linux = zip(*sorted(download_count_linux.items()))
dates_windows, counts_windows = zip(*sorted(download_count_windows.items()))

# Create the download count graphs
plt.figure(figsize=(12, 6))
plt.plot(dates_mac, counts_mac, label="Mac", marker='o')
plt.plot(dates_linux, counts_linux, label="Linux", marker='o')
plt.plot(dates_windows, counts_windows, label="Windows", marker='o')

plt.title("Download Count Over Time for OpenBCI GUI")
plt.xlabel("Release Date")
plt.ylabel("Download Count")
plt.grid(True)
plt.legend()

# Rotate x-axis labels for better readability
plt.xticks(rotation=45)

# Show the graph
plt.tight_layout()
plt.show()