& {
11 | data: NodeDataType;
12 | }) => (
13 | <>
14 | {data.targetPositions &&
15 | data.targetPositions.map(({ position, id }) => (
16 |
17 | ))}
18 |
26 | {' '}
27 | {data.label}
28 |
29 | {data.sourcePositions &&
30 | data.sourcePositions.map(({ position, id }) => (
31 |
32 | ))}
33 | >
34 | ),
35 | );
36 |
37 | FailureNode.displayName = 'FailureNode'; // Add display name to the component
38 | export { FailureNode }; // Export the component
39 |
--------------------------------------------------------------------------------
/telemetry/packages/ui/app/components/views/state-machine/nodes/active-node.tsx:
--------------------------------------------------------------------------------
1 | import { memo } from 'react';
2 | import { Handle, NodeProps } from 'reactflow';
3 | import { BASE_NODE_STYLES } from './styles';
4 | import { cn } from '@/lib/utils';
5 | import { NodeDataType } from '../types';
6 |
7 | const ActiveNode = memo(
8 | ({
9 | data,
10 | }: Omit & {
11 | data: NodeDataType;
12 | }) => (
13 | <>
14 | {data.targetPositions &&
15 | data.targetPositions.map(({ position, id }) => (
16 |
17 | ))}
18 |
26 | {' '}
27 | {data.label}
28 |
29 | {data.sourcePositions &&
30 | data.sourcePositions.map(({ position, id }) => (
31 |
32 | ))}
33 | >
34 | ),
35 | );
36 |
37 | ActiveNode.displayName = 'ActiveNode'; // Add display name to the component
38 | export { ActiveNode }; // Export the component
39 |
--------------------------------------------------------------------------------
/lib/io/hardware_adc.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "adc.hpp"
4 |
5 | #include
6 | #include // for atoi
7 | #include
8 | #include
9 |
10 | #include
11 | #include
12 |
13 | namespace hyped::io {
14 |
15 | class HardwareAdc : public IAdc {
16 | public:
17 | /**
18 | * @brief Creates an Adc instance
19 | * @param pin is one of the 7 analogue input pins on the bbb
20 | */
21 | static std::optional> create(core::ILogger &logger,
22 | const std::uint8_t pin);
23 | HardwareAdc(core::ILogger &logger, const int file_descriptor);
24 | ~HardwareAdc();
25 |
26 | std::optional readValue() override;
27 |
28 | private:
29 | /**
30 | * @param file_descriptor specifying the file voltage values are read from
31 | * @return std::uint16_t returns two bytes of current voltage data
32 | */
33 | std::optional resetAndRead4(const int file_descriptor);
34 |
35 | core::ILogger &logger_;
36 | std::uint8_t pin_;
37 | const int file_descriptor_;
38 |
39 | static constexpr std::uint16_t kMaxAdcRawValue = 4096;
40 | static constexpr core::Float kMaxAdcVoltage = 1.8;
41 | };
42 |
43 | } // namespace hyped::io
44 |
--------------------------------------------------------------------------------
/telemetry/packages/ui/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { resolve } from 'path';
2 | import { defineConfig, loadEnv } from 'vite';
3 | import { viteStaticCopy } from 'vite-plugin-static-copy';
4 | import tsconfigPaths from 'vite-tsconfig-paths';
5 | import react from '@vitejs/plugin-react';
6 |
7 | // https://vitejs.dev/config/
8 | export default defineConfig(({ command, mode }) => {
9 | process.env = { ...process.env, ...loadEnv(mode, process.cwd(), '') };
10 | return {
11 | server: {
12 | host: process.env.HOST || 'localhost',
13 | watch: {
14 | usePolling: true,
15 | },
16 | },
17 | build: {
18 | rollupOptions: {
19 | input: {
20 | main: resolve(__dirname, 'index.html'),
21 | app: resolve(__dirname, 'app/index.html'),
22 | openmct: resolve(__dirname, 'openmct/index.html'),
23 | },
24 | onwarn: (warning, warn) => {
25 | if (warning.code === 'MODULE_LEVEL_DIRECTIVE') return;
26 | warn(warning);
27 | },
28 | },
29 | },
30 | plugins: [
31 | viteStaticCopy({
32 | targets: [
33 | {
34 | src: './node_modules/openmct/dist/*',
35 | dest: 'openmct-lib',
36 | },
37 | ],
38 | }),
39 | tsconfigPaths(),
40 | react(),
41 | ],
42 | };
43 | });
44 |
--------------------------------------------------------------------------------
/test/utils/manual_time.cpp:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #include
4 |
5 | namespace hyped::test {
6 |
7 | void test_set_time(utils::ManualTime &manual_time, const std::time_t time)
8 | {
9 | const auto time_point = std::chrono::system_clock::from_time_t(time);
10 | manual_time.set_time(time_point);
11 | ASSERT_EQ(manual_time.now(), time_point);
12 | }
13 |
14 | TEST(ManualTime, setTime)
15 | {
16 | utils::ManualTime manual_time;
17 | test_set_time(manual_time, 0);
18 | test_set_time(manual_time, 1000);
19 | test_set_time(manual_time, 100);
20 | test_set_time(manual_time, 2000);
21 | }
22 |
23 | void test_set_seconds_since_epoch(utils::ManualTime &manual_time,
24 | const std::uint64_t seconds_since_epoch)
25 | {
26 | manual_time.set_seconds_since_epoch(seconds_since_epoch);
27 | ASSERT_EQ(
28 | std::chrono::duration_cast(manual_time.now().time_since_epoch()).count(),
29 | seconds_since_epoch);
30 | }
31 |
32 | TEST(ManualTime, basic)
33 | {
34 | utils::ManualTime manual_time;
35 | test_set_seconds_since_epoch(manual_time, 0);
36 | test_set_seconds_since_epoch(manual_time, 1000);
37 | test_set_seconds_since_epoch(manual_time, 100);
38 | test_set_seconds_since_epoch(manual_time, 2000);
39 | }
40 |
41 | } // namespace hyped::test
42 |
--------------------------------------------------------------------------------
/lib/debug/commands/command.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | #include