File size: 8,793 Bytes
a481e76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Engineering Data - Space Packet Sleuth</title>
    <link rel="stylesheet" href="style.css">
    <script src="https://cdn.tailwindcss.com"></script>
    <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body class="bg-gray-900 text-white">
    <custom-navbar></custom-navbar>
    
    <div class="container mx-auto px-4 py-8">
        <header class="mb-12">
            <h1 class="text-4xl font-bold mb-4">Engineering Data</h1>
            <p class="text-xl text-gray-300">Monitoring spacecraft subsystems and health</p>
        </header>

        <div class="grid grid-cols-1 md:grid-cols-2 gap-8 mb-8">
            <!-- Power System -->
            <div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
                <div class="flex items-center mb-4">
                    <i data-feather="battery" class="mr-2 text-yellow-400"></i>
                    <h2 class="text-2xl font-semibold">Power System</h2>
                </div>
                <div class="grid grid-cols-2 gap-4 mb-4">
                    <div class="bg-gray-700/50 p-3 rounded-lg">
                        <div class="text-sm text-gray-400">Battery Charge</div>
                        <div class="text-xl">84%</div>
                    </div>
                    <div class="bg-gray-700/50 p-3 rounded-lg">
                        <div class="text-sm text-gray-400">Solar Input</div>
                        <div class="text-xl">120W</div>
                    </div>
                </div>
                <div class="h-48">
                    <canvas id="power-chart"></canvas>
                </div>
            </div>

            <!-- Thermal System -->
            <div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
                <div class="flex items-center mb-4">
                    <i data-feather="thermometer" class="mr-2 text-red-400"></i>
                    <h2 class="text-2xl font-semibold">Thermal System</h2>
                </div>
                <div class="grid grid-cols-2 gap-4 mb-4">
                    <div class="bg-gray-700/50 p-3 rounded-lg">
                        <div class="text-sm text-gray-400">Max Temp</div>
                        <div class="text-xl">28°C</div>
                    </div>
                    <div class="bg-gray-700/50 p-3 rounded-lg">
                        <div class="text-sm text-gray-400">Min Temp</div>
                        <div class="text-xl">-12°C</div>
                    </div>
                </div>
                <div class="h-48">
                    <canvas id="thermal-chart"></canvas>
                </div>
            </div>
        </div>

        <!-- Attitude Control -->
        <div class="bg-gray-800 rounded-xl p-6 border border-gray-700 mb-8">
            <div class="flex items-center mb-4">
                <i data-feather="compass" class="mr-2 text-blue-400"></i>
                <h2 class="text-2xl font-semibold">Attitude Control</h2>
            </div>
            <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
                <div class="h-64">
                    <canvas id="attitude-chart"></canvas>
                </div>
                <div class="h-64">
                    <canvas id="reaction-wheel-chart"></canvas>
                </div>
                <div class="h-64">
                    <canvas id="magnetorquer-chart"></canvas>
                </div>
            </div>
        </div>
    </div>

    <custom-footer></custom-footer>
    <script src="components/navbar.js"></script>
    <script src="components/footer.js"></script>
    <script>
        feather.replace();
        
        document.addEventListener('DOMContentLoaded', function() {
            // Power Chart
            const ctx1 = document.getElementById('power-chart').getContext('2d');
            new Chart(ctx1, {
                type: 'line',
                data: {
                    labels: Array(24).fill().map((_, i) => i),
                    datasets: [
                        {
                            label: 'Battery Charge',
                            data: Array(24).fill().map(() => Math.random() * 20 + 70),
                            borderColor: 'rgb(234, 179, 8)'
                        },
                        {
                            label: 'Solar Input',
                            data: Array(24).fill().map(() => Math.random() * 50 + 80),
                            borderColor: 'rgb(249, 115, 22)'
                        }
                    ]
                },
                options: { responsive: true, maintainAspectRatio: false }
            });

            // Thermal Chart
            const ctx2 = document.getElementById('thermal-chart').getContext('2d');
            new Chart(ctx2, {
                type: 'line',
                data: {
                    labels: Array(24).fill().map((_, i) => i),
                    datasets: [
                        {
                            label: 'Max Temp',
                            data: Array(24).fill().map(() => Math.random() * 10 + 20),
                            borderColor: 'rgb(239, 68, 68)'
                        },
                        {
                            label: 'Min Temp',
                            data: Array(24).fill().map(() => Math.random() * 10 - 15),
                            borderColor: 'rgb(59, 130, 246)'
                        }
                    ]
                },
                options: { responsive: true, maintainAspectRatio: false }
            });

            // Attitude Charts
            const ctx3 = document.getElementById('attitude-chart').getContext('2d');
            new Chart(ctx3, {
                type: 'scatter',
                data: {
                    datasets: [{
                        label: 'Attitude Error',
                        data: Array(20).fill().map(() => ({
                            x: Math.random() * 5 - 2.5,
                            y: Math.random() * 5 - 2.5
                        })),
                        backgroundColor: 'rgba(59, 130, 246, 0.7)'
                    }]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    scales: {
                        x: { title: { display: true, text: 'Pitch (deg)' } },
                        y: { title: { display: true, text: 'Roll (deg)' } }
                    }
                }
            });

            const ctx4 = document.getElementById('reaction-wheel-chart').getContext('2d');
            new Chart(ctx4, {
                type: 'line',
                data: {
                    labels: Array(20).fill().map((_, i) => i),
                    datasets: [
                        {
                            label: 'Wheel X',
                            data: Array(20).fill().map(() => Math.random() * 4000 - 2000),
                            borderColor: 'rgb(239, 68, 68)'
                        },
                        {
                            label: 'Wheel Y',
                            data: Array(20).fill().map(() => Math.random() * 4000 - 2000),
                            borderColor: 'rgb(16, 185, 129)'
                        },
                        {
                            label: 'Wheel Z',
                            data: Array(20).fill().map(() => Math.random() * 4000 - 2000),
                            borderColor: 'rgb(139, 92, 246)'
                        }
                    ]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    scales: { y: { title: { display: true, text: 'Speed (rpm)' } } }
                }
            });

            const ctx5 = document.getElementById('magnetorquer-chart').getContext('2d');
            new Chart(ctx5, {
                type: 'bar',
                data: {
                    labels: ['X Torquer', 'Y Torquer', 'Z Torquer'],
                    datasets: [{
                        label: 'Current (mA)',
                        data: [150, 80, 220],
                        backgroundColor: [
                            'rgba(59, 130, 246, 0.8)',
                            'rgba(16, 185, 129, 0.8)',
                            'rgba(139, 92, 246, 0.8)'
                        ]
                    }]
                },
                options: { responsive: true, maintainAspectRatio: false }
            });
        });
    </script>
</body>
</html>