Skip to content

Commit aee17e2

Browse files
Major overhaul for ogs core
1 parent 88f29be commit aee17e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1096
-180
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ gem 'github-pages', group: :jekyll_plugins
77
group :jekyll_plugins do
88
# gem "jekyll-feed"
99
gem "jekyll-seo-tag"
10+
gem "jekyll-tabs"
1011
end

Gemfile.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ GEM
167167
jekyll-sitemap (1.4.0)
168168
jekyll (>= 3.7, < 5.0)
169169
jekyll-swiss (1.0.0)
170+
jekyll-tabs (1.2.1)
171+
jekyll (>= 3.0, < 5.0)
170172
jekyll-theme-architect (0.2.0)
171173
jekyll (> 3.5, < 5.0)
172174
jekyll-seo-tag (~> 2.0)
@@ -281,8 +283,8 @@ PLATFORMS
281283
DEPENDENCIES
282284
github-pages
283285
jekyll
284-
jekyll-feed
285286
jekyll-seo-tag
287+
jekyll-tabs
286288
just-the-docs
287289

288290
BUNDLED WITH

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The main website and documentation for our apps. Any changes pushed to this repo should be automatically published to the site.
22

3-
[https://opengolfsim.com](https://opengolfsim.com)
3+
[https://help.opengolfsim.com](https://help.opengolfsim.com)
44

55

66
The site uses GitHub pages, which uses jekyll under-the-hood to generate the static site files. You can write documents in markdown or html.

_config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ repository: OpenGolfSim/opengolfsim.com
33
# theme: just-the-docs
44
logo: "/assets/logo-clear-white.svg"
55
color_scheme: ogs
6+
plugins:
7+
- jekyll-tabs
68

79
footer_content: 'Copyright &copy; 2025 OpenGolfSim LLC - <a href="/privacy">Privacy</a> - <a href="/terms">Terms and Conditions</a>'
810
last_edit_timestamp: true
911
last_edit_time_format: "%b %e %Y"
1012

1113
show_excerpts: true
14+
enable_copy_code_button: true
1215

1316
aux_links:
1417
# Shop:
@@ -25,6 +28,9 @@ mermaid:
2528
version: "10.6.1"
2629

2730
callouts:
31+
tip:
32+
title: Tip
33+
color: green
2834
note:
2935
title: Note
3036
color: blue

_includes/api-example-js.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
```javascript
2+
const net = require('net');
3+
4+
const PORT = 3111;
5+
const ADDRESS = '127.0.0.1';
6+
7+
const client = new net.Socket();
8+
9+
function sendData(data) {
10+
client.write(JSON.stringify(data));
11+
}
12+
13+
client.connect(PORT, ADDRESS, () => {
14+
console.log('Connected to OpenGolfSim!');
15+
16+
// send device ready
17+
console.log('Sending device ready event...');
18+
sendData({
19+
type: 'device',
20+
status: 'ready'
21+
});
22+
23+
console.log('Sending test shot...');
24+
// send a shot
25+
sendData({
26+
type: 'shot',
27+
shot: {
28+
ballSpeed: 135.0, // mph
29+
verticalLaunchAngle: 11.1, // degrees
30+
horizontalLaunchAngle: 1.2, // degrees
31+
spinAxis: -2.5, // degrees, positive = hook/left, negative = slice/right
32+
spinSpeed: 4800 // ball RPM
33+
}
34+
});
35+
36+
});
37+
38+
client.on('data', (data) => {
39+
console.log('Received data from OpenGolfSim: ' + data);
40+
});
41+
42+
client.on('close', () => {
43+
console.log('Connection was closed');
44+
});
45+
```

_includes/api-example-python.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
```python
2+
import socket
3+
import json
4+
5+
def sendData(sock, payload):
6+
payload_bytes = (json.dumps(payload) + '\n').encode('utf-8')
7+
sock.sendall(payload_bytes)
8+
print(f"Sent: {payload_bytes}")
9+
10+
11+
def main():
12+
host = '127.0.0.1' # or replace with your server's IP
13+
port = 3111
14+
15+
with socket.create_connection((host, port)) as sock:
16+
# Send device ready event
17+
sendData(sock, {
18+
"type": "device",
19+
"status": "ready"
20+
})
21+
22+
# Send shot data event
23+
sendData(sock, {
24+
"type": "shot",
25+
"shot": {
26+
"ballSpeed": 135.0,
27+
"verticalLaunchAngle": 11.1,
28+
"horizontalLaunchAngle": 1.2,
29+
"spinAxis": -2.5,
30+
"spinSpeed": 4800
31+
}
32+
})
33+
34+
buffer = ''
35+
while True:
36+
data = sock.recv(4096)
37+
if not data:
38+
break
39+
buffer += data.decode('utf-8')
40+
41+
# Handle multiple messages (delimited by '\n')
42+
while '\n' in buffer:
43+
msg, buffer = buffer.split('\n', 1)
44+
if msg.strip():
45+
try:
46+
json_msg = json.loads(msg)
47+
print(f"Received JSON: {msg}")
48+
except json.JSONDecodeError:
49+
print(f"Received non-JSON: {msg}")
50+
51+
if __name__ == "__main__":
52+
main()
53+
```

_includes/footer_custom.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<p>
2+
Copyright &copy; 2025 OpenGolfSim LLC
3+
- <a href="/privacy">Privacy</a>
4+
- <a href="/terms">Terms and Conditions</a>
5+
</p>
6+
<script src="/assets/javascript/tabs.js"></script>

_includes/head_custom.html

Whitespace-only changes.

_layouts/home.html

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,20 @@
55
{{ content }}
66

77

8-
{% assign tools = site.pages | where:"category","tools" %}
8+
<h2 class="post-list-heading">Documentation</h2>
9+
<ul class="tool-list">
10+
<li>
11+
<a class="post-link" href="/desktop/">
12+
OpenGolfSim Desktop
13+
</a>
14+
</li>
15+
<li>
16+
<a class="post-link" href="/mobile/">
17+
OpenGolfSim Mobile Control
18+
</a>
19+
</li>
20+
</ul>
21+
<!-- {% assign tools = site.pages | where:"category","tools" %}
922
{% if tools.size > 0 %}
1023
<h2 class="post-list-heading">Products</h2>
1124
<ul class="tool-list">
@@ -22,10 +35,10 @@ <h3>
2235
</li>
2336
{% endfor %}
2437
</ul>
25-
{% endif %}
26-
38+
{% endif %} -->
2739

2840

41+
<!--
2942
{% if site.paginate %}
3043
{% assign posts = paginator.posts %}
3144
{% else %}
@@ -76,4 +89,4 @@ <h3>
7689
</div>
7790
{%- endif %}
7891
79-
{%- endif -%}
92+
{%- endif -%} -->

_posts/2024-11-15-gspro-button-box.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
2-
title: GSPro DIY Button Box
2+
title: DIY Golf Simulator Button Box
33
layout: post
44
# parent: Articles
55
last_modified_date: 2024-11-15
66
thumbnail: /assets/buttonbox/buttonbox_thumb.jpg
77
---
88

9-
After seeing a few other cool DIY boxes online, I decided to try my hand at building my own button box for GSPro. I had some spare arcade parts leftover from a previous project. So after a couple quick cuts and drilling a few holes, I had a prototype button box of my own.
9+
After seeing a few other cool DIY boxes online, I decided to try my hand at building my own floor button box for my golf simulator. I had some spare arcade parts leftover from a previous project. So after a couple quick cuts and drilling a few holes, I had a prototype button box of my own.
1010

11-
The box connects to the PC via an arcade USB encoder (I'd love to upgrade to a wireless version). It appears on the PC as a joystick device, not a normal keyboard. So I needed to write a few scripts and tools for connecting the buttons with actions on GSPro.
11+
The box connects to the PC via an arcade USB encoder (I'd love to upgrade to a wireless version soon). It appears on the PC as a joystick device, not a normal keyboard. So I needed to write a few scripts and tools for connecting the buttons with actions on the sim. (That's actually when OpenGolfSim was born!)
1212

1313
<img src="/assets/button_box_01.jpg" />
1414

@@ -19,9 +19,9 @@ The box connects to the PC via an arcade USB encoder (I'd love to upgrade to a w
1919

2020
## Building the Box
2121

22-
Building the box is fairly easy, you could use anything from a cardboard box to a masterpiece crafted out of burled walnut. Mine fell somewhere in the middle. I used some spare furring strips and chip-board I had laying around
22+
Building the box is fairly easy, you could use anything from some cardboard to something crafted out of burled walnut. Mine fell somewhere in the middle. I used some spare furring strips and chip-board I had laying around.
2323

24-
## Parts List
24+
## Bill of Materials
2525

2626
| Qty. | Item | Price |
2727
| ---- | ------------------------------------------------------------------- | ------ |
@@ -32,7 +32,7 @@ Building the box is fairly easy, you could use anything from a cardboard box to
3232

3333
### Steps
3434

35-
1. You'll first need to determine which buttons you want to know how many buttons to place on the board. I decided on 4 arrow buttons to move the aim point, and 6 other function buttons.
35+
1. You'll first need to determine which actions you'll want easy access to, so you know how many holes to place on the board. I decided on 4 arrow buttons to move the aim point, and 6 other function buttons that I would program later.
3636

3737
- Left/Right/Down/Up
3838
- Mulligan (most used button by far)
@@ -54,12 +54,5 @@ Building the box is fairly easy, you could use anything from a cardboard box to
5454

5555
1. Attach the other buttons to the usb encoder board slots K1-K12. These are for any type of push button.
5656

57-
1. Plug the usb encoder into your computer and launch our [GSPro Button Box](https://github.com/dudewheresmycode/gspro-button-box) app to setup your box.
57+
1. Plug the usb encoder into your computer and launch our [OpenGolfSim Desktop](/desktop/) app to setup your box.
5858

59-
## Handling Drops
60-
61-
GSPro doesn't seem to have a key commands for drop or re-hit (that I could find), or a keyboard way to move between the drop options or menus. So, I had to get creative if I wanted to have that option available on a button.
62-
63-
I decided to try and take a screenshot, and then use OCR (Optical Character Recognition) library to find the position of any text displayed on screen. This way we can find the drop / re-hit buttons when they're presented.
64-
65-
The only downside is that the process takes about a second, which isn't ideal when a user presses a button. You'd want it to be instant. So I added some on screen text that says "Attempting Drop" instantly when you press the button. This way you know it received the button press and is working on finding the right option.

0 commit comments

Comments
 (0)