Skip to content

Commit

Permalink
Merge branch 'main' into py_int_accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
jmthomas committed Dec 3, 2024
2 parents 705f7bf + 556d7e8 commit 2bf4b10
Show file tree
Hide file tree
Showing 312 changed files with 50,881 additions and 4,837 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
name: Codespell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: codespell-project/actions-codespell@v2
with:
# Skip generated code as well as cstol_converter which has false
# positivies on ADN and Adn
skip: ./docs,*.map,*.min.js,*.pem,*.bin,cstol_converter
ignore_words_file: .whitelist
- uses: actions/checkout@v4
- uses: codespell-project/actions-codespell@v2
with:
# Skip generated code as well as cstol_converter which has false
# positivies on ADN and Adn
skip: ./docs,*.map,*.min.js,*.pem,*.bin,cstol_converter,vue.global*,vuetify-labs*
ignore_words_file: .whitelist
4 changes: 4 additions & 0 deletions docs.openc3.com/docusaurus-plugin.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const config = {
tagline: 'OpenC3 COSMOS Documentation',
favicon: 'img/favicon.png',

future: {
experimental_faster: true,
},

// Set the production url of your site here
url: 'https://docs.openc3.com',
// Set the /<baseUrl>/ pathname under which your site is served
Expand Down
4 changes: 4 additions & 0 deletions docs.openc3.com/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const config = {
tagline: 'OpenC3 COSMOS Documentation',
favicon: 'img/favicon.png',

future: {
experimental_faster: true,
},

// Set the production url of your site here
url: 'https://docs.openc3.com',
// Set the /<baseUrl>/ pathname under which your site is served
Expand Down
11 changes: 6 additions & 5 deletions docs.openc3.com/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "^3.5.2",
"@docusaurus/plugin-client-redirects": "^3.5.2",
"@docusaurus/preset-classic": "^3.5.2",
"@docusaurus/core": "^3.6.3",
"@docusaurus/faster": "^3.6.3",
"@docusaurus/plugin-client-redirects": "^3.6.3",
"@docusaurus/preset-classic": "^3.6.3",
"@mdx-js/react": "3.1.0",
"docusaurus-lunr-search": "3.5.0",
"prism-react-renderer": "2.4.0",
"react": "18.3.1",
"react-dom": "18.3.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.5.2",
"@docusaurus/types": "^3.5.2"
"@docusaurus/module-type-aliases": "^3.6.3",
"@docusaurus/types": "^3.6.3"
},
"browserslist": {
"production": [
Expand Down
59 changes: 59 additions & 0 deletions examples/external_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright 2024 OpenC3, Inc.
# All Rights Reserved.
#
# This program is free software; you can modify and/or redistribute it
# under the terms of the GNU Affero General Public License
# as published by the Free Software Foundation; version 3 with
# attribution addendums as found in the LICENSE.txt
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# This file may also be used under the terms of a commercial license
# if purchased from OpenC3, Inc.

import os

os.environ["OPENC3_API_SCHEMA"] = "http"
os.environ["OPENC3_API_HOSTNAME"] = "127.0.0.1"
os.environ["OPENC3_API_PORT"] = "2900"
os.environ["OPENC3_SCRIPT_API_SCHEMA"] = "http"
os.environ["OPENC3_SCRIPT_API_HOSTNAME"] = "127.0.0.1"
os.environ["OPENC3_SCRIPT_API_PORT"] = "2900"
# os.environ["OPENC3_API_USER"] = "admin" # Only set for Enterprise
os.environ["OPENC3_API_PASSWORD"] = "password"
os.environ["OPENC3_NO_STORE"] = "1"
# os.environ["OPENC3_KEYCLOAK_REALM"] = "openc3" # Only set for Enterprise
# os.environ["OPENC3_KEYCLOAK_URL"] = "http://127.0.0.1:2900/auth" # Only set for Enterprise

from openc3.utilities.string import formatted
from openc3.script import *

print(get_target_names())

print(tlm("INST ADCS POSX"))

print(cmd("INST ABORT"))

put_target_file("INST/test.txt", "this is a string test")
file = get_target_file("INST/test.txt")
print(file.read())
file.close()
delete_target_file("INST/test.txt")

with tempfile.NamedTemporaryFile(mode="w+t", suffix=".txt") as save_file:
save_file.write("this is a Io test")
save_file.seek(0)
put_target_file("INST/test.txt", save_file)
file = get_target_file("INST/test.txt")
print(file.read())
file.close()
delete_target_file("INST/test.txt")

put_target_file("INST/test.bin", "\x00\x01\x02\x03\xFF\xEE\xDD\xCC".encode())
file = get_target_file("INST/test.bin")
print(formatted(file.read()))
file.close()
delete_target_file("INST/test.bin")
10 changes: 5 additions & 5 deletions examples/external_script.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# encoding: ascii-8bit

# Copyright 2022 Ball Aerospace & Technologies Corp.
# Copyright 2024 OpenC3, Inc.
# All Rights Reserved.
#
# This program is free software; you can modify and/or redistribute it
Expand All @@ -12,10 +12,6 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.

# Modified by OpenC3, Inc.
# All changes Copyright 2022, OpenC3, Inc.
# All Rights Reserved
#
# This file may also be used under the terms of a commercial license
# if purchased from OpenC3, Inc.
Expand All @@ -26,8 +22,12 @@
ENV['OPENC3_SCRIPT_API_SCHEMA'] ||= 'http'
ENV['OPENC3_SCRIPT_API_HOSTNAME'] ||= '127.0.0.1'
ENV['OPENC3_SCRIPT_API_PORT'] ||= '2900'
# ENV['OPENC3_API_USER'] ||= 'admin' # Only set for Enterprise
ENV['OPENC3_API_PASSWORD'] ||= 'password'
ENV['OPENC3_NO_STORE'] ||= '1'
# ENV['OPENC3_KEYCLOAK_REALM'] ||= 'openc3' # Only set for Enterprise
# ENV['OPENC3_KEYCLOAK_URL'] ||= 'http://127.0.0.1:2900/auth' # Only set for Enterprise


require 'openc3'
require 'openc3/script'
Expand Down
2 changes: 1 addition & 1 deletion examples/hostinstall/centos7/openc3_install_openc3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ GEMS="$SCRIPT_DIR/../../../openc3-cosmos-init/plugins/gems/"
OPENC3_RELEASE_VERSION=5.21.0-beta0

mkdir -p ${GEMS}
cd ${PLUGINS}openc3-tool-base && yarn install && yarn run build && rake build VERSION=${OPENC3_RELEASE_VERSION} && mv *.gem ${GEMS}
cd ${PLUGINS}packages/openc3-tool-base && yarn run build && rake build VERSION=${OPENC3_RELEASE_VERSION} && mv *.gem ${GEMS}
cd ${PLUGINS}packages/openc3-cosmos-tool-admin && yarn run build && rake build VERSION=${OPENC3_RELEASE_VERSION} && mv *.gem ${GEMS}
cd ${PLUGINS}packages/openc3-cosmos-tool-cmdsender && yarn run build && rake build VERSION=${OPENC3_RELEASE_VERSION} && mv *.gem ${GEMS}
cd ${PLUGINS}packages/openc3-cosmos-tool-cmdtlmserver && yarn run build && rake build VERSION=${OPENC3_RELEASE_VERSION} && mv *.gem ${GEMS}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,13 @@ def build_cmd_snippet(packet, target_info)
params = filtered_items.each_with_index.map do |item, index|
if item['data_type'] == 'BLOCK'
# Unpack binary data to uppercase hex string
default = "0x#{item['default'].unpack('H*').first.upcase}"
if item['default'] and String === item['default']
default = "0x#{item['default'].unpack('H*').first.upcase}"
else
default = "''"
end
elsif item['data_type'] == 'STRING'
default = "'#{item['default']}'" || ''
default = "'#{item['default']}'"
else
default = item['default'] || 0
end
Expand Down
18 changes: 11 additions & 7 deletions openc3-cosmos-cmd-tlm-api/app/controllers/tools_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,20 @@ def position
end

def importmap
result = ""
result = Hash.new
result["imports"] = Hash.new

tools = @model_class.all_scopes
inline_tools = {}
tools.each do |key, tool|
inline_tools[key] = tool if tool['inline_url'] and tool['window'] == 'INLINE'
end
result = Hash.new
result["imports"] = Hash.new
inline_tools.each do |key, tool|
result["imports"]["@openc3/tool-#{tool['folder_name']}"] = "/tools/#{tool['folder_name']}/#{tool['inline_url']}"
if tool['import_map_items']
tool['import_map_items'].each do |item_key, item|
result["imports"][item_key] = item
end
end
if tool['inline_url'] and tool['window'] == 'INLINE'
result["imports"]["@openc3/tool-#{tool['folder_name']}"] = "/tools/#{tool['folder_name']}/#{tool['inline_url']}"
end
end
render json: result
end
Expand Down
16 changes: 9 additions & 7 deletions openc3-cosmos-init/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ WORKDIR /openc3/plugins/
USER root

COPY ./plugins/*.json ./
COPY ./plugins/openc3-tool-base/*.json openc3-tool-base/
COPY ./plugins/packages/openc3-tool-base/*.json packages/openc3-tool-base/
COPY ./plugins/packages/openc3-cosmos-tool-admin/*.json packages/openc3-cosmos-tool-admin/
COPY ./plugins/packages/openc3-cosmos-tool-bucketexplorer/*.json packages/openc3-cosmos-tool-bucketexplorer/
COPY ./plugins/packages/openc3-cosmos-tool-cmdsender/*.json packages/openc3-cosmos-tool-cmdsender/
Expand All @@ -36,14 +36,15 @@ COPY ./plugins/packages/openc3-cosmos-demo/*.json packages/openc3-cosmos-demo/
ARG NPM_URL=https://registry.npmjs.org
RUN yarn config set registry $NPM_URL && yarn --network-timeout 600000

COPY ./plugins/docker-package-build.sh ./plugins/docker-package-install.sh ./plugins/babel.config.js ./plugins/.eslintrc.js ./plugins/.nycrc ./
RUN chmod +x ./docker-package-build.sh ./docker-package-install.sh
COPY ./plugins/openc3-tool-base/ openc3-tool-base/
RUN ["/openc3/plugins/docker-package-install.sh", "openc3-tool-base"]
COPY ./plugins/docker-package-build.sh ./plugins/.eslintrc.cjs ./plugins/.nycrc ./
RUN chmod +x ./docker-package-build.sh
COPY ./plugins/packages/openc3-tool-base/ packages/openc3-tool-base/
RUN ["/openc3/plugins/docker-package-build.sh", "openc3-tool-base"]

# Build admin tool
FROM openc3-frontend-tmp AS openc3-tmp1
RUN cd packages/openc3-cosmos-ace-diff && yarn build

# Build admin tool
COPY ./plugins/packages/openc3-cosmos-tool-admin/ packages/openc3-cosmos-tool-admin/
RUN ["/openc3/plugins/docker-package-build.sh", "openc3-cosmos-tool-admin"]

Expand Down Expand Up @@ -117,6 +118,8 @@ RUN ["/openc3/plugins/docker-package-build.sh", "openc3-cosmos-tool-docs"]

FROM ${OPENC3_REGISTRY}/${OPENC3_NAMESPACE}/${OPENC3_BASE_IMAGE}:${OPENC3_TAG}

USER ${USER_ID}:${GROUP_ID}

COPY --from=openc3-tmp1 --chown=${IMAGE_USER}:${IMAGE_GROUP} /openc3/plugins/packages/openc3-cosmos-ace-diff/ /openc3/plugins/packages/openc3-cosmos-ace-diff/
COPY --from=openc3-tmp1 --chown=${IMAGE_USER}:${IMAGE_GROUP} /openc3/plugins/gems/* /openc3/plugins/gems/
COPY --from=openc3-tmp2 --chown=${IMAGE_USER}:${IMAGE_GROUP} /openc3/plugins/gems/* /openc3/plugins/gems/
Expand All @@ -125,7 +128,6 @@ COPY --from=openc3-tmp4 --chown=${IMAGE_USER}:${IMAGE_GROUP} /openc3/plugins/gem
COPY --from=openc3-tmp5 --chown=${IMAGE_USER}:${IMAGE_GROUP} /openc3/plugins/gems/* /openc3/plugins/gems/
COPY --from=openc3-frontend-tmp --chown=${IMAGE_USER}:${IMAGE_GROUP} /openc3/plugins/packages/openc3-tool-common/ /openc3/plugins/packages/openc3-tool-common/
COPY --from=openc3-frontend-tmp --chown=${IMAGE_USER}:${IMAGE_GROUP} /openc3/plugins/yarn.lock /openc3/plugins/yarn.lock
COPY --from=openc3-frontend-tmp --chown=${IMAGE_USER}:${IMAGE_GROUP} /openc3/plugins/openc3-tool-base/yarn.lock /openc3/plugins/yarn-tool-base.lock
COPY --chown=${IMAGE_USER}:${IMAGE_GROUP} ./init.sh /openc3/

COPY --from=minio-mc /bin/mc /bin/mc
Expand Down
File renamed without changes.
11 changes: 0 additions & 11 deletions openc3-cosmos-init/plugins/babel.config.js

This file was deleted.

25 changes: 0 additions & 25 deletions openc3-cosmos-init/plugins/docker-package-install.sh

This file was deleted.

24 changes: 0 additions & 24 deletions openc3-cosmos-init/plugins/openc3-tool-base/babel.config.json

This file was deleted.

49 changes: 0 additions & 49 deletions openc3-cosmos-init/plugins/openc3-tool-base/package.json

This file was deleted.

Loading

0 comments on commit 2bf4b10

Please sign in to comment.