diff --git a/.gitigore b/.gitigore index a4be861..03326db 100644 --- a/.gitigore +++ b/.gitigore @@ -12,7 +12,7 @@ venv.bak/ *.egg-info/ dist/ build/ - +.tmp # IDEs and editors .vscode/ .idea/ diff --git a/auxiliary/aux.py b/auxiliary/aux.py deleted file mode 100644 index a1b3329..0000000 --- a/auxiliary/aux.py +++ /dev/null @@ -1,52 +0,0 @@ -import pygame - - -def selector(): - pygame.init() - try: - width = int(input("Frame Width: ")) - height = int(input("Frame Height: ")) - except: - width = 800 - height = 600 - screen = pygame.display.set_mode((width, height)) - pygame.display.set_caption("UI Design Auxiliary Tool") - selecting = False - start_pos = None - end_pos = None - running = True - screen.fill((0,0,0)) - while running: - screen.fill((0,0,0)) - for event in pygame.event.get(): - if event.type == pygame.QUIT: - running = False - elif event.type == pygame.MOUSEBUTTONDOWN: - if event.button == 1: # 左键 - selecting = True - start_pos = event.pos - elif event.type == pygame.MOUSEMOTION: - if selecting: - end_pos = event.pos - elif event.type == pygame.MOUSEBUTTONUP: - if event.button == 1: - selecting = False - if start_pos and end_pos: - rect = pygame.Rect( - start_pos, - (end_pos[0] - start_pos[0], end_pos[1] - start_pos[1]), - ) - - if selecting and start_pos and end_pos: - rect = pygame.Rect( - start_pos, (end_pos[0] - start_pos[0], end_pos[1] - start_pos[1]) - ) - pygame.draw.rect(screen, (255, 0, 0), rect, 2) # 绘制选区矩形 - - pygame.display.flip() - - pygame.quit() - - -if __name__ == "__main__": - main() diff --git a/auxiliary/index.html b/auxiliary/index.html deleted file mode 100644 index 9e4dbd4..0000000 --- a/auxiliary/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - 图形参数生成器 - - -

图形参数生成器

- -

- -

- -

- -
- - - - \ No newline at end of file diff --git a/auxiliary/script.js b/auxiliary/script.js deleted file mode 100644 index dd95c68..0000000 --- a/auxiliary/script.js +++ /dev/null @@ -1,152 +0,0 @@ -function generateShapeDict(shape, params) { - if (shape === 'rect') { - return { - method: 'rect', - pos: params.pos || [0, 0], - size: params.size || [1, 1], - color: params.color || [255, 255, 255], - width: params.width || 0 - }; - } else if (shape === 'line') { - return { - method: 'line', - start_pos: params.start_pos || [0, 0], - end_pos: params.end_pos || [1, 1], - color: params.color || [255, 255, 255] - }; - } else if (shape === 'circle') { - return { - method: 'circle', - center: params.center || [0, 0], - radius: params.radius || 1, - color: params.color || [255, 255, 255] - }; - } else if (shape === 'ellipse') { - return { - method: 'ellipse', - pos: params.pos || [0, 0], - size: params.size || [1, 1], - color: params.color || [255, 255, 255] - }; - } else if (shape === 'polygon') { - return { - method: 'polygon', - pointlist: params.pointlist || [], - color: params.color || [255, 255, 255] - }; - } else if (shape === 'arc') { - return { - method: 'arc', - pos: params.pos || [0, 0], - size: params.size || [1, 1], - color: params.color || [255, 255, 255], - start_angle: params.start_angle || 0, - stop_angle: params.stop_angle || 3.14 - }; - } else if (shape === 'point') { - return { - method: 'point', - pos: params.pos || [0, 0], - color: params.color || [255, 255, 255] - }; - } else if (shape === 'lines') { - return { - method: 'lines', - pointlist: params.pointlist || [], - color: params.color || [255, 255, 255] - }; - } else { - throw new Error("Unsupported shape type"); - } -} - -document.addEventListener('DOMContentLoaded', function() { - const shapeSelect = document.getElementById('shape'); - const paramsDiv = document.getElementById('params'); - const generateButton = document.getElementById('generate'); - const resultDiv = document.getElementById('result'); - - function createInput(label, id, type = 'text') { - const input = document.createElement('input'); - input.type = type; - input.id = id; - const labelElement = document.createElement('label'); - labelElement.textContent = label + ': '; - labelElement.setAttribute('for', id); - paramsDiv.appendChild(labelElement); - paramsDiv.appendChild(input); - paramsDiv.appendChild(document.createElement('br')); - return input; - } - - function updateParamsInputs() { - paramsDiv.innerHTML = ''; - const shape = shapeSelect.value; - - if (shape === 'rect') { - createInput('矩形位置 (x y)', 'pos'); - createInput('矩形大小 (width height)', 'size'); - createInput('矩形颜色 (R G B)', 'color'); - createInput('矩形边框宽度', 'width', 'number'); - } else if (shape === 'line') { - createInput('起始位置 (x y)', 'start_pos'); - createInput('结束位置 (x y)', 'end_pos'); - createInput('线条颜色 (R G B)', 'color'); - } else if (shape === 'circle') { - createInput('圆心位置 (x y)', 'center'); - createInput('圆的半径', 'radius', 'number'); - createInput('圆的颜色 (R G B)', 'color'); - } else if (shape === 'ellipse') { - createInput('椭圆位置 (x y)', 'pos'); - createInput('椭圆大小 (width height)', 'size'); - createInput('椭圆颜色 (R G B)', 'color'); - } else if (shape === 'polygon') { - createInput('多边形的点 (x1 y1 x2 y2 ...)', 'pointlist'); - createInput('多边形颜色 (R G B)', 'color'); - } else if (shape === 'arc') { - createInput('弧的位置 (x y)', 'pos'); - createInput('弧的大小 (width height)', 'size'); - createInput('弧的颜色 (R G B)', 'color'); - createInput('弧的起始角度 (弧度制)', 'start_angle', 'number'); - createInput('弧的结束角度 (弧度制)', 'stop_angle', 'number'); - } else if (shape === 'point') { - createInput('点的位置 (x y)', 'pos'); - createInput('点的颜色 (R G B)', 'color'); - } else if (shape === 'lines') { - createInput('线段的点 (x1 y1 x2 y2 ...)', 'pointlist'); - createInput('线段颜色 (R G B)', 'color'); - } - } - - shapeSelect.addEventListener('change', updateParamsInputs); - updateParamsInputs(); - - generateButton.addEventListener('click', function() { - const shape = shapeSelect.value; - const params = {}; - const inputs = paramsDiv.querySelectorAll('input'); - - inputs.forEach(input => { - if (input.id === 'pointlist') { - const points = input.value.split(' ').map(Number); - params.pointlist = []; - for (let i = 0; i < points.length; i += 2) { - params.pointlist.push([points[i], points[i + 1]]); - } - } else if (input.id === 'pos' || input.id === 'size' || input.id === 'start_pos' || input.id === 'end_pos' || input.id === 'center' || input.id === 'color') { - params[input.id] = input.value.split(' ').map(Number); - } else if (input.type === 'number') { - params[input.id] = parseFloat(input.value); - } else { - params[input.id] = input.value; - } - }); - - try { - const shapeDict = generateShapeDict(shape, params); - resultDiv.innerHTML = '
' + JSON.stringify(shapeDict, null, 2) + '
'; - } catch (error) { - resultDiv.innerHTML = '

错误: ' + error.message + '

'; - } - }); -}); \ No newline at end of file diff --git a/comet/.python-version b/comet/.python-version new file mode 100644 index 0000000..24ee5b1 --- /dev/null +++ b/comet/.python-version @@ -0,0 +1 @@ +3.13 diff --git a/comet/agent_logs.log b/comet/agent_logs.log new file mode 100644 index 0000000..e69de29 diff --git a/comet/main.py b/comet/main.py new file mode 100644 index 0000000..bbff66f --- /dev/null +++ b/comet/main.py @@ -0,0 +1,6 @@ +def main(): + print("Hello from comet!") + + +if __name__ == "__main__": + main() diff --git a/comet/pyproject.toml b/comet/pyproject.toml new file mode 100644 index 0000000..48f4670 --- /dev/null +++ b/comet/pyproject.toml @@ -0,0 +1,7 @@ +[project] +name = "Comet" +version = "0.1.0" +description = "A onboard controller implementation of AiraPulsar Flight Control System" +readme = "README.md" +requires-python = ">=3.13" +dependencies = [] diff --git a/lib/__init__.py b/lib/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/lib/__pycache__/__init__.cpython-313.pyc b/lib/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000..a2907ba Binary files /dev/null and b/lib/__pycache__/__init__.cpython-313.pyc differ diff --git a/lib/agency/__init__.py b/lib/agency/__init__.py new file mode 100644 index 0000000..90b59bb --- /dev/null +++ b/lib/agency/__init__.py @@ -0,0 +1,4 @@ +from .main import * + +version = '0.1.0' +print(f"Powered by Moons Agency, version {version}") \ No newline at end of file diff --git a/lib/agency/__pycache__/__init__.cpython-312.pyc b/lib/agency/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..c4e4e88 Binary files /dev/null and b/lib/agency/__pycache__/__init__.cpython-312.pyc differ diff --git a/lib/agency/__pycache__/__init__.cpython-313.pyc b/lib/agency/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000..e74954c Binary files /dev/null and b/lib/agency/__pycache__/__init__.cpython-313.pyc differ diff --git a/lib/agency/__pycache__/main.cpython-312.pyc b/lib/agency/__pycache__/main.cpython-312.pyc new file mode 100644 index 0000000..23f6ce1 Binary files /dev/null and b/lib/agency/__pycache__/main.cpython-312.pyc differ diff --git a/lib/agency/__pycache__/main.cpython-313.pyc b/lib/agency/__pycache__/main.cpython-313.pyc new file mode 100644 index 0000000..d83787a Binary files /dev/null and b/lib/agency/__pycache__/main.cpython-313.pyc differ diff --git a/lib/agency.py b/lib/agency/main.py similarity index 100% rename from lib/agency.py rename to lib/agency/main.py diff --git a/pulsar/vgl b/lib/vgl similarity index 100% rename from pulsar/vgl rename to lib/vgl diff --git a/moon/.python-version b/moon/.python-version new file mode 100644 index 0000000..24ee5b1 --- /dev/null +++ b/moon/.python-version @@ -0,0 +1 @@ +3.13 diff --git a/moon/main.py b/moon/main.py new file mode 100644 index 0000000..9d68560 --- /dev/null +++ b/moon/main.py @@ -0,0 +1,6 @@ +def main(): + print("Hello from moon!") + + +if __name__ == "__main__": + main() diff --git a/moon/pyproject.toml b/moon/pyproject.toml new file mode 100644 index 0000000..a9d4400 --- /dev/null +++ b/moon/pyproject.toml @@ -0,0 +1,7 @@ +[project] +name = "Moon" +version = "0.1.0" +description = "A relay server implementation of AiraPulsar Flight Control System" +readme = "README.md" +requires-python = ">=3.13" +dependencies = [] diff --git a/pulsar/.python-version b/pulsar/.python-version new file mode 100644 index 0000000..24ee5b1 --- /dev/null +++ b/pulsar/.python-version @@ -0,0 +1 @@ +3.13 diff --git a/pulsar/agent_logs.log b/pulsar/agent_logs.log new file mode 100644 index 0000000..e69de29 diff --git a/pulsar/components/__pycache__/marker.cpython-312.pyc b/pulsar/components/__pycache__/marker.cpython-312.pyc index 408ec99..e59c0d3 100644 Binary files a/pulsar/components/__pycache__/marker.cpython-312.pyc and b/pulsar/components/__pycache__/marker.cpython-312.pyc differ diff --git a/pulsar/components/__pycache__/marker.cpython-313.pyc b/pulsar/components/__pycache__/marker.cpython-313.pyc new file mode 100644 index 0000000..1187088 Binary files /dev/null and b/pulsar/components/__pycache__/marker.cpython-313.pyc differ diff --git a/pulsar/components/marker.py b/pulsar/components/marker.py index ed7a86c..5feb531 100644 --- a/pulsar/components/marker.py +++ b/pulsar/components/marker.py @@ -1,6 +1,4 @@ -import vgl - - +from lib import vgl name = "Marking Lines" def main(window): @@ -22,3 +20,6 @@ def main(window): for i in lines: i.set_color('#' + str((info['cursor']['position'][0] + info['cursor']['position'][1]*100 + info['cursor']['position'][0]*10000) % 999999).zfill(6)) observer() + #@vgl.loop # TODO + #def toloop(): + # pass \ No newline at end of file diff --git a/pulsar/main.py b/pulsar/main.py index 312643b..76361bb 100644 --- a/pulsar/main.py +++ b/pulsar/main.py @@ -1,9 +1,10 @@ -import vgl +from lib import vgl +from lib import agency import colorama import os import importlib.util -window = vgl.Window(title="Pulsar", size=(1024, 768)) +window = vgl.Window(title="Pulsar", size=(1600, 1000)) def loader(): components_dir = "components" diff --git a/pulsar/pyproject.toml b/pulsar/pyproject.toml new file mode 100644 index 0000000..bd4d8cd --- /dev/null +++ b/pulsar/pyproject.toml @@ -0,0 +1,7 @@ +[project] +name = "Pulsar" +version = "0.1.0" +description = "A client implementation of AiraPulsar Flight Control System" +readme = "README.md" +requires-python = ">=3.13" +dependencies = [] diff --git a/vgl/__pycache__/__init__.cpython-313.pyc b/vgl/__pycache__/__init__.cpython-313.pyc new file mode 100644 index 0000000..96e3308 Binary files /dev/null and b/vgl/__pycache__/__init__.cpython-313.pyc differ diff --git a/vgl/__pycache__/basic_elements.cpython-312.pyc b/vgl/__pycache__/basic_elements.cpython-312.pyc index e31f818..bbf9eeb 100644 Binary files a/vgl/__pycache__/basic_elements.cpython-312.pyc and b/vgl/__pycache__/basic_elements.cpython-312.pyc differ diff --git a/vgl/__pycache__/basic_elements.cpython-313.pyc b/vgl/__pycache__/basic_elements.cpython-313.pyc new file mode 100644 index 0000000..c4f212e Binary files /dev/null and b/vgl/__pycache__/basic_elements.cpython-313.pyc differ diff --git a/vgl/__pycache__/main.cpython-312.pyc b/vgl/__pycache__/main.cpython-312.pyc index bfc7b4d..8006907 100644 Binary files a/vgl/__pycache__/main.cpython-312.pyc and b/vgl/__pycache__/main.cpython-312.pyc differ diff --git a/vgl/__pycache__/main.cpython-313.pyc b/vgl/__pycache__/main.cpython-313.pyc new file mode 100644 index 0000000..81380d1 Binary files /dev/null and b/vgl/__pycache__/main.cpython-313.pyc differ diff --git a/vgl/basic_elements.py b/vgl/basic_elements.py index b4d4a65..c0e2ae1 100644 --- a/vgl/basic_elements.py +++ b/vgl/basic_elements.py @@ -1,4 +1,4 @@ -from vgl.main import * +from .main import * import pygame import time