Spaces:
Running
Running
undefined - Initial Deployment
Browse files- README.md +7 -5
- index.html +776 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: bitmin
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: gray
|
| 5 |
+
colorTo: green
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,776 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Magrav-Bitcoin Mining Control System</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
| 9 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 10 |
+
<style>
|
| 11 |
+
.gauge-container {
|
| 12 |
+
position: relative;
|
| 13 |
+
width: 100%;
|
| 14 |
+
height: 0;
|
| 15 |
+
padding-bottom: 50%;
|
| 16 |
+
}
|
| 17 |
+
.gauge {
|
| 18 |
+
position: absolute;
|
| 19 |
+
top: 0;
|
| 20 |
+
left: 0;
|
| 21 |
+
width: 100%;
|
| 22 |
+
height: 100%;
|
| 23 |
+
}
|
| 24 |
+
.alert-flash {
|
| 25 |
+
animation: flash 2s infinite;
|
| 26 |
+
}
|
| 27 |
+
@keyframes flash {
|
| 28 |
+
0% { opacity: 1; }
|
| 29 |
+
50% { opacity: 0.5; }
|
| 30 |
+
100% { opacity: 1; }
|
| 31 |
+
}
|
| 32 |
+
.chart-container {
|
| 33 |
+
position: relative;
|
| 34 |
+
height: 300px;
|
| 35 |
+
width: 100%;
|
| 36 |
+
}
|
| 37 |
+
.system-status {
|
| 38 |
+
transition: all 0.3s ease;
|
| 39 |
+
}
|
| 40 |
+
.emergency-active {
|
| 41 |
+
animation: pulse 1s infinite;
|
| 42 |
+
}
|
| 43 |
+
@keyframes pulse {
|
| 44 |
+
0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
|
| 45 |
+
70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
|
| 46 |
+
100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
|
| 47 |
+
}
|
| 48 |
+
</style>
|
| 49 |
+
</head>
|
| 50 |
+
<body class="bg-gray-900 text-gray-100 min-h-screen">
|
| 51 |
+
<div class="container mx-auto px-4 py-8">
|
| 52 |
+
<!-- Header -->
|
| 53 |
+
<div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-8">
|
| 54 |
+
<div>
|
| 55 |
+
<h1 class="text-3xl md:text-4xl font-bold mb-2">
|
| 56 |
+
<i class="fas fa-bolt text-yellow-400 mr-2"></i>
|
| 57 |
+
Magrav-Bitcoin Mining Control System
|
| 58 |
+
</h1>
|
| 59 |
+
<p class="text-gray-400">Experimental Power Integration Monitoring</p>
|
| 60 |
+
</div>
|
| 61 |
+
<div class="mt-4 md:mt-0 flex items-center">
|
| 62 |
+
<div id="systemStatus" class="system-status px-4 py-2 rounded-full flex items-center
|
| 63 |
+
bg-gray-800 border border-gray-700">
|
| 64 |
+
<span class="w-3 h-3 rounded-full bg-red-500 mr-2"></span>
|
| 65 |
+
<span>System Offline</span>
|
| 66 |
+
</div>
|
| 67 |
+
</div>
|
| 68 |
+
</div>
|
| 69 |
+
|
| 70 |
+
<!-- System Stats -->
|
| 71 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
| 72 |
+
<!-- Magrav Output -->
|
| 73 |
+
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
|
| 74 |
+
<div class="flex justify-between items-center mb-4">
|
| 75 |
+
<h3 class="text-lg font-semibold">
|
| 76 |
+
<i class="fas fa-atom text-red-400 mr-2"></i>
|
| 77 |
+
Magrav Output
|
| 78 |
+
</h3>
|
| 79 |
+
<span class="text-xs bg-gray-700 px-2 py-1 rounded">Experimental</span>
|
| 80 |
+
</div>
|
| 81 |
+
<div class="flex items-end justify-between">
|
| 82 |
+
<div>
|
| 83 |
+
<div class="text-3xl font-bold text-red-400" id="magravOutput">0</div>
|
| 84 |
+
<div class="text-gray-400 text-sm">Watts</div>
|
| 85 |
+
</div>
|
| 86 |
+
<div class="gauge-container">
|
| 87 |
+
<canvas id="magravGauge" class="gauge"></canvas>
|
| 88 |
+
</div>
|
| 89 |
+
</div>
|
| 90 |
+
</div>
|
| 91 |
+
|
| 92 |
+
<!-- Battery Status -->
|
| 93 |
+
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
|
| 94 |
+
<div class="flex justify-between items-center mb-4">
|
| 95 |
+
<h3 class="text-lg font-semibold">
|
| 96 |
+
<i class="fas fa-battery-three-quarters text-green-400 mr-2"></i>
|
| 97 |
+
Battery Status
|
| 98 |
+
</h3>
|
| 99 |
+
<span class="text-xs bg-gray-700 px-2 py-1 rounded">48V LiFePO4</span>
|
| 100 |
+
</div>
|
| 101 |
+
<div class="flex items-end justify-between">
|
| 102 |
+
<div>
|
| 103 |
+
<div class="text-3xl font-bold text-green-400" id="batteryCapacity">0</div>
|
| 104 |
+
<div class="text-gray-400 text-sm" id="batteryVoltage">0.0V</div>
|
| 105 |
+
</div>
|
| 106 |
+
<div class="gauge-container">
|
| 107 |
+
<canvas id="batteryGauge" class="gauge"></canvas>
|
| 108 |
+
</div>
|
| 109 |
+
</div>
|
| 110 |
+
</div>
|
| 111 |
+
|
| 112 |
+
<!-- DC Output -->
|
| 113 |
+
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
|
| 114 |
+
<div class="flex justify-between items-center mb-4">
|
| 115 |
+
<h3 class="text-lg font-semibold">
|
| 116 |
+
<i class="fas fa-plug text-blue-400 mr-2"></i>
|
| 117 |
+
DC Output
|
| 118 |
+
</h3>
|
| 119 |
+
<span class="text-xs bg-gray-700 px-2 py-1 rounded">12V Target</span>
|
| 120 |
+
</div>
|
| 121 |
+
<div class="flex items-end justify-between">
|
| 122 |
+
<div>
|
| 123 |
+
<div class="text-3xl font-bold text-blue-400" id="dcVoltage">0.00</div>
|
| 124 |
+
<div class="text-gray-400 text-sm">Volts</div>
|
| 125 |
+
</div>
|
| 126 |
+
<div class="gauge-container">
|
| 127 |
+
<canvas id="voltageGauge" class="gauge"></canvas>
|
| 128 |
+
</div>
|
| 129 |
+
</div>
|
| 130 |
+
</div>
|
| 131 |
+
|
| 132 |
+
<!-- Mining Power -->
|
| 133 |
+
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
|
| 134 |
+
<div class="flex justify-between items-center mb-4">
|
| 135 |
+
<h3 class="text-lg font-semibold">
|
| 136 |
+
<i class="fas fa-microchip text-orange-400 mr-2"></i>
|
| 137 |
+
Mining Power
|
| 138 |
+
</h3>
|
| 139 |
+
<span class="text-xs bg-gray-700 px-2 py-1 rounded">500W Test Rig</span>
|
| 140 |
+
</div>
|
| 141 |
+
<div class="flex items-end justify-between">
|
| 142 |
+
<div>
|
| 143 |
+
<div class="text-3xl font-bold text-orange-400" id="minerPower">0</div>
|
| 144 |
+
<div class="text-gray-400 text-sm" id="gridPower">Grid: 0W</div>
|
| 145 |
+
</div>
|
| 146 |
+
<div class="gauge-container">
|
| 147 |
+
<canvas id="minerGauge" class="gauge"></canvas>
|
| 148 |
+
</div>
|
| 149 |
+
</div>
|
| 150 |
+
</div>
|
| 151 |
+
</div>
|
| 152 |
+
|
| 153 |
+
<!-- Control Panel -->
|
| 154 |
+
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700 mb-8">
|
| 155 |
+
<h3 class="text-xl font-semibold mb-6">
|
| 156 |
+
<i class="fas fa-sliders-h text-gray-400 mr-2"></i>
|
| 157 |
+
System Controls
|
| 158 |
+
</h3>
|
| 159 |
+
|
| 160 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
|
| 161 |
+
<!-- System Toggle -->
|
| 162 |
+
<button id="systemToggle"
|
| 163 |
+
class="px-6 py-3 rounded-lg font-semibold bg-gray-700 hover:bg-gray-600 text-white transition-colors flex items-center justify-center">
|
| 164 |
+
<i class="fas fa-power-off mr-2"></i>
|
| 165 |
+
Power ON
|
| 166 |
+
</button>
|
| 167 |
+
|
| 168 |
+
<!-- Mining Toggle -->
|
| 169 |
+
<button id="miningToggle" disabled
|
| 170 |
+
class="px-6 py-3 rounded-lg font-semibold bg-gray-700 text-gray-400 transition-colors flex items-center justify-center cursor-not-allowed">
|
| 171 |
+
<i class="fas fa-digging mr-2"></i>
|
| 172 |
+
Mining OFF
|
| 173 |
+
</button>
|
| 174 |
+
|
| 175 |
+
<!-- Emergency Stop -->
|
| 176 |
+
<button id="emergencyStop"
|
| 177 |
+
class="px-6 py-3 rounded-lg font-semibold bg-red-600 hover:bg-red-700 text-white transition-colors flex items-center justify-center">
|
| 178 |
+
<i class="fas fa-exclamation-triangle mr-2"></i>
|
| 179 |
+
Emergency Stop
|
| 180 |
+
</button>
|
| 181 |
+
|
| 182 |
+
<!-- Reset System -->
|
| 183 |
+
<button id="resetSystem" disabled
|
| 184 |
+
class="px-6 py-3 rounded-lg font-semibold bg-blue-600 text-blue-200 transition-colors flex items-center justify-center cursor-not-allowed">
|
| 185 |
+
<i class="fas fa-sync-alt mr-2"></i>
|
| 186 |
+
Reset System
|
| 187 |
+
</button>
|
| 188 |
+
</div>
|
| 189 |
+
|
| 190 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 191 |
+
<!-- Power Flow Chart -->
|
| 192 |
+
<div class="bg-gray-900 rounded-lg p-4 border border-gray-700">
|
| 193 |
+
<h4 class="text-lg font-semibold mb-4">
|
| 194 |
+
<i class="fas fa-exchange-alt text-purple-400 mr-2"></i>
|
| 195 |
+
Power Flow
|
| 196 |
+
</h4>
|
| 197 |
+
<div class="chart-container">
|
| 198 |
+
<canvas id="powerFlowChart"></canvas>
|
| 199 |
+
</div>
|
| 200 |
+
</div>
|
| 201 |
+
|
| 202 |
+
<!-- System Health Chart -->
|
| 203 |
+
<div class="bg-gray-900 rounded-lg p-4 border border-gray-700">
|
| 204 |
+
<h4 class="text-lg font-semibold mb-4">
|
| 205 |
+
<i class="fas fa-heartbeat text-green-400 mr-2"></i>
|
| 206 |
+
System Health
|
| 207 |
+
</h4>
|
| 208 |
+
<div class="chart-container">
|
| 209 |
+
<canvas id="healthChart"></canvas>
|
| 210 |
+
</div>
|
| 211 |
+
</div>
|
| 212 |
+
</div>
|
| 213 |
+
</div>
|
| 214 |
+
|
| 215 |
+
<!-- Alerts and Statistics -->
|
| 216 |
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
| 217 |
+
<!-- Alerts Panel -->
|
| 218 |
+
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
|
| 219 |
+
<h3 class="text-xl font-semibold mb-4 flex items-center">
|
| 220 |
+
<i class="fas fa-exclamation-circle text-yellow-400 mr-2"></i>
|
| 221 |
+
System Alerts
|
| 222 |
+
</h3>
|
| 223 |
+
<div class="space-y-2 max-h-64 overflow-y-auto pr-2" id="alertsContainer">
|
| 224 |
+
<div class="p-3 rounded-lg bg-gray-900 border-l-4 border-gray-500">
|
| 225 |
+
<div class="flex justify-between items-start">
|
| 226 |
+
<span class="text-sm">System initialized and ready</span>
|
| 227 |
+
<span class="text-xs text-gray-400">Just now</span>
|
| 228 |
+
</div>
|
| 229 |
+
</div>
|
| 230 |
+
</div>
|
| 231 |
+
</div>
|
| 232 |
+
|
| 233 |
+
<!-- Statistics Panel -->
|
| 234 |
+
<div class="bg-gray-800 rounded-xl p-6 border border-gray-700">
|
| 235 |
+
<h3 class="text-xl font-semibold mb-4 flex items-center">
|
| 236 |
+
<i class="fas fa-chart-line text-blue-400 mr-2"></i>
|
| 237 |
+
Experiment Statistics
|
| 238 |
+
</h3>
|
| 239 |
+
|
| 240 |
+
<div class="space-y-4 mb-6">
|
| 241 |
+
<div class="flex justify-between items-center">
|
| 242 |
+
<span class="text-gray-300">
|
| 243 |
+
<i class="fas fa-bolt text-yellow-400 mr-2"></i>
|
| 244 |
+
Total Energy from Magrav:
|
| 245 |
+
</span>
|
| 246 |
+
<span class="font-semibold text-green-400" id="totalEnergy">0.000 kWh</span>
|
| 247 |
+
</div>
|
| 248 |
+
<div class="flex justify-between items-center">
|
| 249 |
+
<span class="text-gray-300">
|
| 250 |
+
<i class="fas fa-dollar-sign text-green-400 mr-2"></i>
|
| 251 |
+
Theoretical Cost Savings:
|
| 252 |
+
</span>
|
| 253 |
+
<span class="font-semibold text-green-400" id="costSavings">$0.00</span>
|
| 254 |
+
</div>
|
| 255 |
+
<div class="flex justify-between items-center">
|
| 256 |
+
<span class="text-gray-300">
|
| 257 |
+
<i class="fas fa-tachometer-alt text-blue-400 mr-2"></i>
|
| 258 |
+
System Efficiency:
|
| 259 |
+
</span>
|
| 260 |
+
<span class="font-semibold text-blue-400" id="systemEfficiency">0%</span>
|
| 261 |
+
</div>
|
| 262 |
+
<div class="flex justify-between items-center">
|
| 263 |
+
<span class="text-gray-300">
|
| 264 |
+
<i class="fas fa-plug text-orange-400 mr-2"></i>
|
| 265 |
+
Grid Dependence:
|
| 266 |
+
</span>
|
| 267 |
+
<span class="font-semibold text-orange-400" id="gridDependence">0%</span>
|
| 268 |
+
</div>
|
| 269 |
+
</div>
|
| 270 |
+
|
| 271 |
+
<div class="p-4 bg-yellow-900 rounded-lg border border-yellow-700">
|
| 272 |
+
<h4 class="font-semibold text-yellow-300 mb-2 flex items-center">
|
| 273 |
+
<i class="fas fa-exclamation-triangle mr-2"></i>
|
| 274 |
+
Experimental Notice
|
| 275 |
+
</h4>
|
| 276 |
+
<p class="text-sm text-yellow-200">
|
| 277 |
+
This system is for research purposes only. Real-world performance may vary significantly from simulated results.
|
| 278 |
+
Always follow proper electrical safety procedures when working with experimental power systems.
|
| 279 |
+
</p>
|
| 280 |
+
</div>
|
| 281 |
+
</div>
|
| 282 |
+
</div>
|
| 283 |
+
</div>
|
| 284 |
+
|
| 285 |
+
<script>
|
| 286 |
+
// System Configuration
|
| 287 |
+
const CONFIG = {
|
| 288 |
+
MAGRAV_MAX_OUTPUT: 2000, // 2kW claimed max
|
| 289 |
+
BATTERY_NOMINAL_VOLTAGE: 48.0,
|
| 290 |
+
BATTERY_CAPACITY: 10000, // 10kWh
|
| 291 |
+
DC_VOLTAGE_TARGET: 12.0,
|
| 292 |
+
DC_VOLTAGE_TOLERANCE: 0.6, // ±5%
|
| 293 |
+
MINER_POWER_RATING: 500, // 500W GPU rig
|
| 294 |
+
GRID_RATE: 0.12, // $0.12/kWh
|
| 295 |
+
SAFETY_THRESHOLDS: {
|
| 296 |
+
OVERVOLTAGE: 12.6,
|
| 297 |
+
UNDERVOLTAGE: 11.4,
|
| 298 |
+
OVERTEMPERATURE: 75
|
| 299 |
+
}
|
| 300 |
+
};
|
| 301 |
+
|
| 302 |
+
// System State
|
| 303 |
+
let systemState = {
|
| 304 |
+
systemEnabled: false,
|
| 305 |
+
emergencyStop: false,
|
| 306 |
+
miningEnabled: false,
|
| 307 |
+
magravOutput: 0,
|
| 308 |
+
batteryVoltage: 44.0,
|
| 309 |
+
batteryCapacity: 20,
|
| 310 |
+
dcVoltage: 0,
|
| 311 |
+
minerPower: 0,
|
| 312 |
+
gridPower: 0
|
| 313 |
+
};
|
| 314 |
+
|
| 315 |
+
// Performance Data
|
| 316 |
+
let performanceData = [];
|
| 317 |
+
let alerts = [];
|
| 318 |
+
let totalEnergy = 0;
|
| 319 |
+
let costSavings = 0;
|
| 320 |
+
let updateInterval;
|
| 321 |
+
let alertId = 0;
|
| 322 |
+
|
| 323 |
+
// DOM Elements
|
| 324 |
+
const systemStatusEl = document.getElementById('systemStatus');
|
| 325 |
+
const systemToggleBtn = document.getElementById('systemToggle');
|
| 326 |
+
const miningToggleBtn = document.getElementById('miningToggle');
|
| 327 |
+
const emergencyStopBtn = document.getElementById('emergencyStop');
|
| 328 |
+
const resetSystemBtn = document.getElementById('resetSystem');
|
| 329 |
+
const alertsContainer = document.getElementById('alertsContainer');
|
| 330 |
+
|
| 331 |
+
// Gauge Charts
|
| 332 |
+
const magravGauge = createGauge('magravGauge', 'Magrav Output', 'W', 0, CONFIG.MAGRAV_MAX_OUTPUT, 'red');
|
| 333 |
+
const batteryGauge = createGauge('batteryGauge', 'Battery', '%', 0, 100, 'green');
|
| 334 |
+
const voltageGauge = createGauge('voltageGauge', 'DC Voltage', 'V', 10, 14, 'blue');
|
| 335 |
+
const minerGauge = createGauge('minerGauge', 'Miner Power', 'W', 0, CONFIG.MINER_POWER_RATING, 'orange');
|
| 336 |
+
|
| 337 |
+
// Line Charts
|
| 338 |
+
const powerFlowChart = createLineChart('powerFlowChart', ['Magrav Output', 'Miner Power', 'Grid Power'], ['#EF4444', '#F97316', '#3B82F6']);
|
| 339 |
+
const healthChart = createLineChart('healthChart', ['Battery %', 'DC Voltage'], ['#10B981', '#8B5CF6']);
|
| 340 |
+
|
| 341 |
+
// Initialize system
|
| 342 |
+
updateUI();
|
| 343 |
+
addAlert('info', 'System initialized and ready');
|
| 344 |
+
|
| 345 |
+
// Event Listeners
|
| 346 |
+
systemToggleBtn.addEventListener('click', toggleSystem);
|
| 347 |
+
miningToggleBtn.addEventListener('click', toggleMining);
|
| 348 |
+
emergencyStopBtn.addEventListener('click', emergencyStop);
|
| 349 |
+
resetSystemBtn.addEventListener('click', resetSystem);
|
| 350 |
+
|
| 351 |
+
// System Functions
|
| 352 |
+
function toggleSystem() {
|
| 353 |
+
if (systemState.emergencyStop) return;
|
| 354 |
+
|
| 355 |
+
systemState.systemEnabled = !systemState.systemEnabled;
|
| 356 |
+
systemState.miningEnabled = false;
|
| 357 |
+
|
| 358 |
+
if (systemState.systemEnabled) {
|
| 359 |
+
startSystem();
|
| 360 |
+
addAlert('info', 'System powered ON');
|
| 361 |
+
} else {
|
| 362 |
+
stopSystem();
|
| 363 |
+
addAlert('info', 'System powered OFF');
|
| 364 |
+
}
|
| 365 |
+
|
| 366 |
+
updateUI();
|
| 367 |
+
}
|
| 368 |
+
|
| 369 |
+
function toggleMining() {
|
| 370 |
+
if (systemState.dcVoltage < CONFIG.SAFETY_THRESHOLDS.UNDERVOLTAGE) {
|
| 371 |
+
addAlert('error', 'Cannot enable mining - DC voltage too low');
|
| 372 |
+
return;
|
| 373 |
+
}
|
| 374 |
+
|
| 375 |
+
systemState.miningEnabled = !systemState.miningEnabled;
|
| 376 |
+
|
| 377 |
+
if (systemState.miningEnabled) {
|
| 378 |
+
addAlert('info', 'Mining enabled');
|
| 379 |
+
} else {
|
| 380 |
+
addAlert('info', 'Mining disabled');
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
updateUI();
|
| 384 |
+
}
|
| 385 |
+
|
| 386 |
+
function emergencyStop() {
|
| 387 |
+
systemState.emergencyStop = true;
|
| 388 |
+
systemState.systemEnabled = false;
|
| 389 |
+
systemState.miningEnabled = false;
|
| 390 |
+
|
| 391 |
+
clearInterval(updateInterval);
|
| 392 |
+
addAlert('error', 'EMERGENCY STOP ACTIVATED');
|
| 393 |
+
|
| 394 |
+
updateUI();
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
function resetSystem() {
|
| 398 |
+
systemState.emergencyStop = false;
|
| 399 |
+
addAlert('info', 'System reset completed');
|
| 400 |
+
|
| 401 |
+
updateUI();
|
| 402 |
+
}
|
| 403 |
+
|
| 404 |
+
function startSystem() {
|
| 405 |
+
// Initialize performance data
|
| 406 |
+
performanceData = [];
|
| 407 |
+
|
| 408 |
+
// Start update loop
|
| 409 |
+
updateInterval = setInterval(updateSystem, 1000);
|
| 410 |
+
}
|
| 411 |
+
|
| 412 |
+
function stopSystem() {
|
| 413 |
+
clearInterval(updateInterval);
|
| 414 |
+
}
|
| 415 |
+
|
| 416 |
+
function updateSystem() {
|
| 417 |
+
if (systemState.emergencyStop) return;
|
| 418 |
+
|
| 419 |
+
// Simulate Magrav output
|
| 420 |
+
systemState.magravOutput = simulateMagravOutput();
|
| 421 |
+
|
| 422 |
+
// Calculate mining power
|
| 423 |
+
systemState.minerPower = calculateMinerPower();
|
| 424 |
+
|
| 425 |
+
// Update battery state
|
| 426 |
+
const batteryState = updateBatteryState(systemState.magravOutput, systemState.minerPower);
|
| 427 |
+
systemState.batteryCapacity = batteryState.capacity;
|
| 428 |
+
systemState.batteryVoltage = batteryState.voltage;
|
| 429 |
+
|
| 430 |
+
// Calculate DC output
|
| 431 |
+
systemState.dcVoltage = calculateDCOutput(systemState.batteryVoltage, systemState.minerPower);
|
| 432 |
+
|
| 433 |
+
// Calculate grid power
|
| 434 |
+
systemState.gridPower = Math.max(0, systemState.minerPower - systemState.magravOutput);
|
| 435 |
+
|
| 436 |
+
// Update totals
|
| 437 |
+
totalEnergy += systemState.magravOutput / 3600000; // Convert to kWh
|
| 438 |
+
costSavings += (systemState.magravOutput * CONFIG.GRID_RATE) / 3600000;
|
| 439 |
+
|
| 440 |
+
// Add data point
|
| 441 |
+
const dataPoint = {
|
| 442 |
+
timestamp: new Date().toLocaleTimeString(),
|
| 443 |
+
magravOutput: systemState.magravOutput,
|
| 444 |
+
minerPower: systemState.minerPower,
|
| 445 |
+
batteryCapacity: systemState.batteryCapacity,
|
| 446 |
+
dcVoltage: systemState.dcVoltage,
|
| 447 |
+
gridPower: systemState.gridPower
|
| 448 |
+
};
|
| 449 |
+
|
| 450 |
+
performanceData.push(dataPoint);
|
| 451 |
+
if (performanceData.length > 15) {
|
| 452 |
+
performanceData.shift();
|
| 453 |
+
}
|
| 454 |
+
|
| 455 |
+
// Check safety conditions
|
| 456 |
+
checkSafetyConditions();
|
| 457 |
+
|
| 458 |
+
// Update UI
|
| 459 |
+
updateUI();
|
| 460 |
+
}
|
| 461 |
+
|
| 462 |
+
function simulateMagravOutput() {
|
| 463 |
+
if (!systemState.systemEnabled) return 0;
|
| 464 |
+
|
| 465 |
+
// Simulate erratic/experimental behavior
|
| 466 |
+
const baseOutput = CONFIG.MAGRAV_MAX_OUTPUT * 0.3; // 30% of claimed
|
| 467 |
+
const variation = Math.sin(Date.now() / 10000) * 200;
|
| 468 |
+
const noise = (Math.random() - 0.5) * 300;
|
| 469 |
+
|
| 470 |
+
return Math.max(0, baseOutput + variation + noise);
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
function updateBatteryState(magravInput, minerLoad) {
|
| 474 |
+
const currentCapacity = systemState.batteryCapacity;
|
| 475 |
+
const chargeRate = magravInput / CONFIG.BATTERY_CAPACITY * 100;
|
| 476 |
+
const dischargeRate = minerLoad / CONFIG.BATTERY_CAPACITY * 100;
|
| 477 |
+
|
| 478 |
+
const netChange = chargeRate - dischargeRate;
|
| 479 |
+
const newCapacity = Math.max(0, Math.min(100, currentCapacity + netChange * 0.1));
|
| 480 |
+
|
| 481 |
+
const voltage = 44.0 + (newCapacity / 100) * 8.0; // 44V to 52V range
|
| 482 |
+
|
| 483 |
+
return { capacity: newCapacity, voltage };
|
| 484 |
+
}
|
| 485 |
+
|
| 486 |
+
function calculateDCOutput(batteryVoltage, load) {
|
| 487 |
+
if (batteryVoltage < 44.0) return 0; // Undervoltage cutoff
|
| 488 |
+
|
| 489 |
+
const efficiency = 0.95; // 95% efficiency
|
| 490 |
+
const regulation = CONFIG.DC_VOLTAGE_TARGET;
|
| 491 |
+
const loadEffect = load > 400 ? -0.1 : 0; // Voltage drop under heavy load
|
| 492 |
+
|
| 493 |
+
return regulation + loadEffect;
|
| 494 |
+
}
|
| 495 |
+
|
| 496 |
+
function calculateMinerPower() {
|
| 497 |
+
if (!systemState.miningEnabled || systemState.dcVoltage < CONFIG.SAFETY_THRESHOLDS.UNDERVOLTAGE) {
|
| 498 |
+
return 0;
|
| 499 |
+
}
|
| 500 |
+
|
| 501 |
+
const basePower = CONFIG.MINER_POWER_RATING;
|
| 502 |
+
const voltageEffect = (systemState.dcVoltage - 12.0) / 12.0 * 50;
|
| 503 |
+
|
| 504 |
+
return basePower + voltageEffect;
|
| 505 |
+
}
|
| 506 |
+
|
| 507 |
+
function checkSafetyConditions() {
|
| 508 |
+
const { dcVoltage, batteryVoltage } = systemState;
|
| 509 |
+
|
| 510 |
+
if (dcVoltage > CONFIG.SAFETY_THRESHOLDS.OVERVOLTAGE) {
|
| 511 |
+
addAlert('error', 'DC Overvoltage detected! System shutdown initiated.');
|
| 512 |
+
systemState.emergencyStop = true;
|
| 513 |
+
systemState.miningEnabled = false;
|
| 514 |
+
systemState.systemEnabled = false;
|
| 515 |
+
stopSystem();
|
| 516 |
+
return false;
|
| 517 |
+
}
|
| 518 |
+
|
| 519 |
+
if (dcVoltage < CONFIG.SAFETY_THRESHOLDS.UNDERVOLTAGE && systemState.miningEnabled) {
|
| 520 |
+
addAlert('warning', 'DC Undervoltage - Mining disabled for protection.');
|
| 521 |
+
systemState.miningEnabled = false;
|
| 522 |
+
}
|
| 523 |
+
|
| 524 |
+
if (batteryVoltage < 44.0) {
|
| 525 |
+
addAlert('warning', 'Battery critically low - System protection activated.');
|
| 526 |
+
systemState.miningEnabled = false;
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
return true;
|
| 530 |
+
}
|
| 531 |
+
|
| 532 |
+
function addAlert(type, message) {
|
| 533 |
+
const alert = {
|
| 534 |
+
id: alertId++,
|
| 535 |
+
type,
|
| 536 |
+
message,
|
| 537 |
+
timestamp: new Date().toLocaleTimeString()
|
| 538 |
+
};
|
| 539 |
+
|
| 540 |
+
alerts.unshift(alert);
|
| 541 |
+
if (alerts.length > 10) {
|
| 542 |
+
alerts.pop();
|
| 543 |
+
}
|
| 544 |
+
|
| 545 |
+
// Create alert element
|
| 546 |
+
const alertEl = document.createElement('div');
|
| 547 |
+
alertEl.className = `p-3 rounded-lg border-l-4 mb-2 ${
|
| 548 |
+
type === 'error' ? 'bg-red-900 border-red-500' :
|
| 549 |
+
type === 'warning' ? 'bg-yellow-900 border-yellow-500' :
|
| 550 |
+
'bg-blue-900 border-blue-500'
|
| 551 |
+
}`;
|
| 552 |
+
|
| 553 |
+
alertEl.innerHTML = `
|
| 554 |
+
<div class="flex justify-between items-start">
|
| 555 |
+
<span class="text-sm">${message}</span>
|
| 556 |
+
<span class="text-xs text-gray-400">${alert.timestamp}</span>
|
| 557 |
+
</div>
|
| 558 |
+
`;
|
| 559 |
+
|
| 560 |
+
alertsContainer.insertBefore(alertEl, alertsContainer.firstChild);
|
| 561 |
+
|
| 562 |
+
// Flash alert
|
| 563 |
+
if (type === 'error') {
|
| 564 |
+
alertEl.classList.add('alert-flash');
|
| 565 |
+
}
|
| 566 |
+
}
|
| 567 |
+
|
| 568 |
+
function updateUI() {
|
| 569 |
+
// Update status display
|
| 570 |
+
if (systemState.emergencyStop) {
|
| 571 |
+
systemStatusEl.innerHTML = `
|
| 572 |
+
<span class="w-3 h-3 rounded-full bg-red-500 mr-2 animate-pulse"></span>
|
| 573 |
+
<span>EMERGENCY STOP</span>
|
| 574 |
+
`;
|
| 575 |
+
systemStatusEl.classList.add('emergency-active');
|
| 576 |
+
} else if (systemState.systemEnabled) {
|
| 577 |
+
systemStatusEl.innerHTML = `
|
| 578 |
+
<span class="w-3 h-3 rounded-full bg-green-500 mr-2"></span>
|
| 579 |
+
<span>System Online</span>
|
| 580 |
+
`;
|
| 581 |
+
systemStatusEl.classList.remove('emergency-active');
|
| 582 |
+
} else {
|
| 583 |
+
systemStatusEl.innerHTML = `
|
| 584 |
+
<span class="w-3 h-3 rounded-full bg-red-500 mr-2"></span>
|
| 585 |
+
<span>System Offline</span>
|
| 586 |
+
`;
|
| 587 |
+
systemStatusEl.classList.remove('emergency-active');
|
| 588 |
+
}
|
| 589 |
+
|
| 590 |
+
// Update control buttons
|
| 591 |
+
systemToggleBtn.innerHTML = `
|
| 592 |
+
<i class="fas fa-power-off mr-2"></i>
|
| 593 |
+
${systemState.systemEnabled ? 'Power OFF' : 'Power ON'}
|
| 594 |
+
`;
|
| 595 |
+
systemToggleBtn.className = systemState.systemEnabled ?
|
| 596 |
+
'px-6 py-3 rounded-lg font-semibold bg-green-600 hover:bg-green-700 text-white transition-colors flex items-center justify-center' :
|
| 597 |
+
'px-6 py-3 rounded-lg font-semibold bg-gray-700 hover:bg-gray-600 text-white transition-colors flex items-center justify-center';
|
| 598 |
+
|
| 599 |
+
miningToggleBtn.disabled = !systemState.systemEnabled || systemState.emergencyStop;
|
| 600 |
+
miningToggleBtn.innerHTML = `
|
| 601 |
+
<i class="fas fa-digging mr-2"></i>
|
| 602 |
+
${systemState.miningEnabled ? 'Mining OFF' : 'Mining ON'}
|
| 603 |
+
`;
|
| 604 |
+
miningToggleBtn.className = systemState.miningEnabled ?
|
| 605 |
+
'px-6 py-3 rounded-lg font-semibold bg-orange-600 hover:bg-orange-700 text-white transition-colors flex items-center justify-center' :
|
| 606 |
+
'px-6 py-3 rounded-lg font-semibold bg-gray-700 hover:bg-gray-600 text-white transition-colors flex items-center justify-center';
|
| 607 |
+
|
| 608 |
+
if (miningToggleBtn.disabled) {
|
| 609 |
+
miningToggleBtn.className = 'px-6 py-3 rounded-lg font-semibold bg-gray-700 text-gray-400 transition-colors flex items-center justify-center cursor-not-allowed';
|
| 610 |
+
}
|
| 611 |
+
|
| 612 |
+
resetSystemBtn.disabled = !systemState.emergencyStop;
|
| 613 |
+
if (resetSystemBtn.disabled) {
|
| 614 |
+
resetSystemBtn.className = 'px-6 py-3 rounded-lg font-semibold bg-blue-600 text-blue-200 transition-colors flex items-center justify-center cursor-not-allowed';
|
| 615 |
+
} else {
|
| 616 |
+
resetSystemBtn.className = 'px-6 py-3 rounded-lg font-semibold bg-blue-600 hover:bg-blue-700 text-white transition-colors flex items-center justify-center';
|
| 617 |
+
}
|
| 618 |
+
|
| 619 |
+
// Update numeric displays
|
| 620 |
+
document.getElementById('magravOutput').textContent = systemState.magravOutput.toFixed(1);
|
| 621 |
+
document.getElementById('batteryCapacity').textContent = systemState.batteryCapacity.toFixed(1);
|
| 622 |
+
document.getElementById('batteryVoltage').textContent = systemState.batteryVoltage.toFixed(1) + 'V';
|
| 623 |
+
document.getElementById('dcVoltage').textContent = systemState.dcVoltage.toFixed(2);
|
| 624 |
+
document.getElementById('minerPower').textContent = systemState.minerPower.toFixed(1);
|
| 625 |
+
document.getElementById('gridPower').textContent = `Grid: ${systemState.gridPower.toFixed(1)}W`;
|
| 626 |
+
|
| 627 |
+
// Update statistics
|
| 628 |
+
document.getElementById('totalEnergy').textContent = totalEnergy.toFixed(3) + ' kWh';
|
| 629 |
+
document.getElementById('costSavings').textContent = '$' + costSavings.toFixed(2);
|
| 630 |
+
|
| 631 |
+
const efficiency = systemState.magravOutput > 0 ?
|
| 632 |
+
((systemState.minerPower / systemState.magravOutput) * 100).toFixed(1) : 0;
|
| 633 |
+
document.getElementById('systemEfficiency').textContent = efficiency + '%';
|
| 634 |
+
|
| 635 |
+
const gridDependence = systemState.minerPower > 0 ?
|
| 636 |
+
((systemState.gridPower / systemState.minerPower) * 100).toFixed(1) : 0;
|
| 637 |
+
document.getElementById('gridDependence').textContent = gridDependence + '%';
|
| 638 |
+
|
| 639 |
+
// Update gauges
|
| 640 |
+
updateGauge(magravGauge, systemState.magravOutput);
|
| 641 |
+
updateGauge(batteryGauge, systemState.batteryCapacity);
|
| 642 |
+
updateGauge(voltageGauge, systemState.dcVoltage);
|
| 643 |
+
updateGauge(minerGauge, systemState.minerPower);
|
| 644 |
+
|
| 645 |
+
// Update line charts
|
| 646 |
+
updateLineChart(powerFlowChart, performanceData, ['magravOutput', 'minerPower', 'gridPower']);
|
| 647 |
+
updateLineChart(healthChart, performanceData, ['batteryCapacity', 'dcVoltage']);
|
| 648 |
+
}
|
| 649 |
+
|
| 650 |
+
// Chart Functions
|
| 651 |
+
function createGauge(canvasId, label, unit, min, max, color) {
|
| 652 |
+
const canvas = document.getElementById(canvasId);
|
| 653 |
+
const ctx = canvas.getContext('2d');
|
| 654 |
+
|
| 655 |
+
return {
|
| 656 |
+
ctx,
|
| 657 |
+
label,
|
| 658 |
+
unit,
|
| 659 |
+
min,
|
| 660 |
+
max,
|
| 661 |
+
color,
|
| 662 |
+
value: 0
|
| 663 |
+
};
|
| 664 |
+
}
|
| 665 |
+
|
| 666 |
+
function updateGauge(gauge, value) {
|
| 667 |
+
const { ctx, label, unit, min, max, color } = gauge;
|
| 668 |
+
const width = ctx.canvas.width;
|
| 669 |
+
const height = ctx.canvas.height;
|
| 670 |
+
|
| 671 |
+
// Clear canvas
|
| 672 |
+
ctx.clearRect(0, 0, width, height);
|
| 673 |
+
|
| 674 |
+
// Draw gauge background
|
| 675 |
+
ctx.beginPath();
|
| 676 |
+
ctx.arc(width / 2, height / 2, Math.min(width, height) / 2 - 10, 0.75 * Math.PI, 2.25 * Math.PI);
|
| 677 |
+
ctx.lineWidth = 20;
|
| 678 |
+
ctx.strokeStyle = '#374151';
|
| 679 |
+
ctx.stroke();
|
| 680 |
+
|
| 681 |
+
// Calculate angle for value
|
| 682 |
+
const normalizedValue = Math.min(Math.max(value, min), max);
|
| 683 |
+
const angle = 0.75 * Math.PI + (1.5 * Math.PI * (normalizedValue - min) / (max - min));
|
| 684 |
+
|
| 685 |
+
// Draw gauge value
|
| 686 |
+
ctx.beginPath();
|
| 687 |
+
ctx.arc(width / 2, height / 2, Math.min(width, height) / 2 - 10, 0.75 * Math.PI, angle);
|
| 688 |
+
ctx.lineWidth = 20;
|
| 689 |
+
ctx.strokeStyle = color;
|
| 690 |
+
ctx.stroke();
|
| 691 |
+
|
| 692 |
+
// Draw gauge center
|
| 693 |
+
ctx.fillStyle = '#1F2937';
|
| 694 |
+
ctx.beginPath();
|
| 695 |
+
ctx.arc(width / 2, height / 2, Math.min(width, height) / 2 - 30, 0, 2 * Math.PI);
|
| 696 |
+
ctx.fill();
|
| 697 |
+
|
| 698 |
+
// Draw value text
|
| 699 |
+
ctx.fillStyle = '#F3F4F6';
|
| 700 |
+
ctx.font = 'bold ' + (Math.min(width, height) / 5) + 'px Arial';
|
| 701 |
+
ctx.textAlign = 'center';
|
| 702 |
+
ctx.textBaseline = 'middle';
|
| 703 |
+
ctx.fillText(normalizedValue.toFixed(1), width / 2, height / 2);
|
| 704 |
+
|
| 705 |
+
// Draw unit text
|
| 706 |
+
ctx.fillStyle = '#9CA3AF';
|
| 707 |
+
ctx.font = (Math.min(width, height) / 8) + 'px Arial';
|
| 708 |
+
ctx.fillText(unit, width / 2, height / 2 + (Math.min(width, height) / 6));
|
| 709 |
+
}
|
| 710 |
+
|
| 711 |
+
function createLineChart(canvasId, datasets, colors) {
|
| 712 |
+
const canvas = document.getElementById(canvasId);
|
| 713 |
+
const ctx = canvas.getContext('2d');
|
| 714 |
+
|
| 715 |
+
return new Chart(ctx, {
|
| 716 |
+
type: 'line',
|
| 717 |
+
data: {
|
| 718 |
+
labels: [],
|
| 719 |
+
datasets: datasets.map((label, i) => ({
|
| 720 |
+
label,
|
| 721 |
+
data: [],
|
| 722 |
+
borderColor: colors[i],
|
| 723 |
+
backgroundColor: colors[i] + '20',
|
| 724 |
+
borderWidth: 2,
|
| 725 |
+
tension: 0.3,
|
| 726 |
+
fill: true
|
| 727 |
+
}))
|
| 728 |
+
},
|
| 729 |
+
options: {
|
| 730 |
+
responsive: true,
|
| 731 |
+
maintainAspectRatio: false,
|
| 732 |
+
scales: {
|
| 733 |
+
x: {
|
| 734 |
+
grid: {
|
| 735 |
+
color: '#374151'
|
| 736 |
+
},
|
| 737 |
+
ticks: {
|
| 738 |
+
color: '#9CA3AF'
|
| 739 |
+
}
|
| 740 |
+
},
|
| 741 |
+
y: {
|
| 742 |
+
grid: {
|
| 743 |
+
color: '#374151'
|
| 744 |
+
},
|
| 745 |
+
ticks: {
|
| 746 |
+
color: '#9CA3AF'
|
| 747 |
+
}
|
| 748 |
+
}
|
| 749 |
+
},
|
| 750 |
+
plugins: {
|
| 751 |
+
legend: {
|
| 752 |
+
labels: {
|
| 753 |
+
color: '#F3F4F6'
|
| 754 |
+
}
|
| 755 |
+
}
|
| 756 |
+
},
|
| 757 |
+
interaction: {
|
| 758 |
+
intersect: false,
|
| 759 |
+
mode: 'index'
|
| 760 |
+
}
|
| 761 |
+
}
|
| 762 |
+
});
|
| 763 |
+
}
|
| 764 |
+
|
| 765 |
+
function updateLineChart(chart, data, fields) {
|
| 766 |
+
chart.data.labels = data.map(item => item.timestamp);
|
| 767 |
+
|
| 768 |
+
fields.forEach((field, i) => {
|
| 769 |
+
chart.data.datasets[i].data = data.map(item => item[field]);
|
| 770 |
+
});
|
| 771 |
+
|
| 772 |
+
chart.update();
|
| 773 |
+
}
|
| 774 |
+
</script>
|
| 775 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Gaslighttheghost/bitmin" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 776 |
+
</html>
|