up
This commit is contained in:
@@ -3,11 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<<<<<<< HEAD
|
||||
<title>ShackMaster - F4BPO Shack</title>
|
||||
=======
|
||||
<title>ShackMaster - XV9Q Shack</title>
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet">
|
||||
|
||||
129
web/src/app.css
129
web/src/app.css
@@ -1,5 +1,4 @@
|
||||
:root {
|
||||
<<<<<<< HEAD
|
||||
/* Modern dark theme inspired by FlexDXCluster */
|
||||
--bg-primary: #0a1628;
|
||||
--bg-secondary: #1a2332;
|
||||
@@ -436,132 +435,4 @@ select:focus {
|
||||
order: 3;
|
||||
width: 100%;
|
||||
}
|
||||
=======
|
||||
--bg-primary: #1a1a1a;
|
||||
--bg-secondary: #2a2a2a;
|
||||
--bg-card: #333333;
|
||||
--text-primary: #ffffff;
|
||||
--text-secondary: #b0b0b0;
|
||||
--accent-teal: #00bcd4;
|
||||
--accent-green: #4caf50;
|
||||
--accent-red: #f44336;
|
||||
--accent-blue: #2196f3;
|
||||
--border-color: #444444;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
||||
background-color: var(--bg-primary);
|
||||
color: var(--text-primary);
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
#app {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
button {
|
||||
font-family: inherit;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
outline: none;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
button:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
input, select {
|
||||
font-family: inherit;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.status-indicator {
|
||||
display: inline-block;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.status-online {
|
||||
background-color: var(--accent-green);
|
||||
box-shadow: 0 0 8px var(--accent-green);
|
||||
}
|
||||
|
||||
.status-offline {
|
||||
background-color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 12px 24px;
|
||||
border-radius: 6px;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: var(--accent-green);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: #45a049;
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background: var(--accent-red);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-danger:hover {
|
||||
background: #da190b;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: var(--bg-secondary);
|
||||
color: var(--text-primary);
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.value-display {
|
||||
font-size: 24px;
|
||||
font-weight: 300;
|
||||
color: var(--accent-teal);
|
||||
}
|
||||
|
||||
.label {
|
||||
font-size: 12px;
|
||||
color: var(--text-secondary);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
margin-bottom: 4px;
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
<script>
|
||||
import { api } from '../lib/api.js';
|
||||
<<<<<<< HEAD
|
||||
|
||||
export let status;
|
||||
|
||||
@@ -21,7 +20,7 @@
|
||||
|
||||
async function selectAntenna(port, antennaNum) {
|
||||
try {
|
||||
await api.antenna.selectAntenna(port, antennaNum, antennaNum);
|
||||
await api.antenna.selectAntenna(port, antennaNum);
|
||||
} catch (err) {
|
||||
console.error('Failed to select antenna:', err);
|
||||
alert('Failed to select antenna');
|
||||
@@ -37,25 +36,10 @@
|
||||
} catch (err) {
|
||||
console.error('Failed to reboot:', err);
|
||||
alert('Failed to reboot');
|
||||
=======
|
||||
|
||||
export let status;
|
||||
|
||||
$: radio1Antenna = status?.radio1_antenna || 0;
|
||||
$: radio2Antenna = status?.radio2_antenna || 0;
|
||||
$: connected = status?.connected || false;
|
||||
|
||||
async function setRadioAntenna(radio, antenna) {
|
||||
try {
|
||||
await api.antenna.set(radio, antenna);
|
||||
} catch (err) {
|
||||
console.error('Failed to set antenna:', err);
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<<<<<<< HEAD
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Antenna Genius</h2>
|
||||
@@ -88,29 +72,30 @@
|
||||
{#each antennas as antenna}
|
||||
{@const isPortATx = portA.tx && portA.tx_ant === antenna.number}
|
||||
{@const isPortBTx = portB.tx && portB.tx_ant === antenna.number}
|
||||
{@const isPortARx = !portA.tx && (portA.rx_ant === antenna.number || portA.tx_ant === antenna.number)}
|
||||
{@const isPortBRx = !portB.tx && (portB.rx_ant === antenna.number || portB.tx_ant === antenna.number)}
|
||||
{@const isPortARx = !portA.tx && portA.rx_ant === antenna.number}
|
||||
{@const isPortBRx = !portB.tx && portB.rx_ant === antenna.number}
|
||||
{@const isTx = isPortATx || isPortBTx}
|
||||
{@const isActive = isPortARx || isPortBRx}
|
||||
{@const isActiveA = isPortARx || isPortATx}
|
||||
{@const isActiveB = isPortBRx || isPortBTx}
|
||||
|
||||
<div
|
||||
class="antenna-card"
|
||||
class:tx={isTx}
|
||||
class:active-a={isPortARx}
|
||||
class:active-b={isPortBRx}
|
||||
class:active-a={isActiveA}
|
||||
class:active-b={isActiveB}
|
||||
>
|
||||
<div class="antenna-name">{antenna.name}</div>
|
||||
<div class="antenna-ports">
|
||||
<button
|
||||
class="port-btn"
|
||||
class:active={portA.tx_ant === antenna.number || portA.rx_ant === antenna.number}
|
||||
class:active={isActiveA}
|
||||
on:click={() => selectAntenna(1, antenna.number)}
|
||||
>
|
||||
A
|
||||
</button>
|
||||
<button
|
||||
class="port-btn"
|
||||
class:active={portB.tx_ant === antenna.number || portB.rx_ant === antenna.number}
|
||||
class:active={isActiveB}
|
||||
on:click={() => selectAntenna(2, antenna.number)}
|
||||
>
|
||||
B
|
||||
@@ -125,53 +110,10 @@
|
||||
<span class="reboot-icon">🔄</span>
|
||||
REBOOT
|
||||
</button>
|
||||
=======
|
||||
<div class="antenna-card card">
|
||||
<h2>
|
||||
AG 8X2
|
||||
<span class="status-indicator" class:status-online={connected} class:status-offline={!connected}></span>
|
||||
</h2>
|
||||
|
||||
<div class="radio-section">
|
||||
<div class="radio-label">Radio 1 / Radio 2</div>
|
||||
|
||||
<div class="radio-grid">
|
||||
<div class="radio-column">
|
||||
<div class="radio-title">Radio 1</div>
|
||||
<div class="antenna-slots">
|
||||
{#each Array(4) as _, i}
|
||||
<button
|
||||
class="slot"
|
||||
class:active={radio1Antenna === i}
|
||||
on:click={() => setRadioAntenna(1, i)}
|
||||
>
|
||||
{i + 1}
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="radio-column">
|
||||
<div class="radio-title">Radio 2</div>
|
||||
<div class="antenna-slots">
|
||||
{#each Array(4) as _, i}
|
||||
<button
|
||||
class="slot"
|
||||
class:active={radio2Antenna === i}
|
||||
on:click={() => setRadioAntenna(2, i)}
|
||||
>
|
||||
{i + 1}
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
<<<<<<< HEAD
|
||||
.card {
|
||||
background: linear-gradient(135deg, #1a2332 0%, #0f1923 100%);
|
||||
border: 1px solid #2d3748;
|
||||
@@ -365,72 +307,5 @@
|
||||
|
||||
.reboot-icon {
|
||||
font-size: 16px;
|
||||
=======
|
||||
.antenna-card {
|
||||
min-width: 300px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 16px;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: var(--accent-teal);
|
||||
}
|
||||
|
||||
.radio-section {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.radio-label {
|
||||
font-size: 12px;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.radio-grid {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.radio-column {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.radio-title {
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.antenna-slots {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.slot {
|
||||
padding: 16px;
|
||||
background: var(--bg-secondary);
|
||||
color: var(--text-primary);
|
||||
border: 2px solid var(--border-color);
|
||||
border-radius: 6px;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.slot:hover {
|
||||
border-color: var(--accent-blue);
|
||||
}
|
||||
|
||||
.slot.active {
|
||||
background: var(--accent-blue);
|
||||
border-color: var(--accent-blue);
|
||||
color: white;
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,4 @@
|
||||
<script>
|
||||
<<<<<<< HEAD
|
||||
import { api } from '../lib/api.js';
|
||||
|
||||
export let status;
|
||||
@@ -234,160 +233,11 @@
|
||||
|
||||
.metrics {
|
||||
padding: 16px;
|
||||
=======
|
||||
export let status;
|
||||
|
||||
$: powerForward = status?.power_forward || 0;
|
||||
$: powerReflected = status?.power_reflected || 0;
|
||||
$: swr = status?.swr || 1.0;
|
||||
$: voltage = status?.voltage || 0;
|
||||
$: vdd = status?.vdd || 0;
|
||||
$: current = status?.current || 0;
|
||||
$: peakCurrent = status?.peak_current || 0;
|
||||
$: temperature = status?.temperature || 0;
|
||||
$: harmonicLoadTemp = status?.harmonic_load_temp || 0;
|
||||
$: fanMode = status?.fan_mode || 'CONTEST';
|
||||
$: state = status?.state || 'IDLE';
|
||||
$: bandA = status?.band_a || '0';
|
||||
$: bandB = status?.band_b || '0';
|
||||
$: connected = status?.connected || false;
|
||||
$: displayState = state.replace('TRANSMIT_A', 'TRANSMIT').replace('TRANSMIT_B', 'TRANSMIT');
|
||||
$: meffa = status?.meffa || 'STANDBY';
|
||||
|
||||
async function setFanMode(mode) {
|
||||
try {
|
||||
await api.power.setFanMode(mode);
|
||||
} catch (err) {
|
||||
console.error('Failed to set fan mode:', err);
|
||||
alert('Failed to set fan mode');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="powergenius-card card">
|
||||
<h2>
|
||||
PGXL
|
||||
<span class="status-indicator" class:status-online={connected} class:status-offline={!connected}></span>
|
||||
</h2>
|
||||
|
||||
<div class="status-row">
|
||||
<div class="status-label" class:normal={state === 'IDLE'} class:warning={state.includes('TRANSMIT')}>
|
||||
{displayState}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="metrics">
|
||||
<div class="metric">
|
||||
<div class="label">FWD PWR (W)</div>
|
||||
<div class="value">{powerForward.toFixed(1)}</div>
|
||||
<div class="bar">
|
||||
<div class="bar-fill" style="width: {Math.min(100, (powerForward / 1500) * 100)}%"></div>
|
||||
</div>
|
||||
<div class="scale">
|
||||
<span>0</span>
|
||||
<span>1000</span>
|
||||
<span>2000</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="metric">
|
||||
<div class="label">PG XL SWR 1:1.00 use</div>
|
||||
<div class="value">{swr.toFixed(2)}</div>
|
||||
</div>
|
||||
|
||||
<div class="metric">
|
||||
<div class="label">Temp / HL Temp</div>
|
||||
<div class="value">{temperature.toFixed(0)}°C / {harmonicLoadTemp.toFixed(1)}°C</div>
|
||||
<div class="bar">
|
||||
<div class="bar-fill" style="width: {(temperature / 80) * 100}%"></div>
|
||||
</div>
|
||||
<div class="scale">
|
||||
<span>25</span>
|
||||
<span>55</span>
|
||||
<span>80</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="metric-row">
|
||||
<div class="metric small">
|
||||
<div class="label">VAC</div>
|
||||
<div class="value">{voltage.toFixed(0)}</div>
|
||||
</div>
|
||||
<div class="metric small">
|
||||
<div class="label">VDD</div>
|
||||
<div class="value">{vdd.toFixed(1)}</div>
|
||||
</div>
|
||||
<div class="metric small">
|
||||
<div class="label">ID peak</div>
|
||||
<div class="value">{peakCurrent.toFixed(1)}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fan-speed">
|
||||
<div class="label">Fan Speed</div>
|
||||
<select value={fanMode} on:change={(e) => setFanMode(e.target.value)}>
|
||||
<option value="STANDARD">STANDARD</option>
|
||||
<option value="CONTEST">CONTEST</option>
|
||||
<option value="BROADCAST">BROADCAST</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="band-info">
|
||||
<div class="label">Band A</div>
|
||||
<div class="value">{bandA}</div>
|
||||
</div>
|
||||
<div class="band-info">
|
||||
<div class="label">Band B</div>
|
||||
<div class="value">{bandB}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
.powergenius-card {
|
||||
min-width: 350px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 12px;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: var(--accent-teal);
|
||||
}
|
||||
|
||||
.status-label {
|
||||
display: inline-block;
|
||||
padding: 8px 16px;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.status-label.normal {
|
||||
background: var(--accent-green);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.status-label.warning {
|
||||
background: var(--accent-red);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.metrics {
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
/* Power Display */
|
||||
.power-display {
|
||||
display: flex;
|
||||
@@ -589,65 +439,10 @@ async function setFanMode(mode) {
|
||||
}
|
||||
|
||||
.band-item {
|
||||
=======
|
||||
.metric {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.metric-row {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.metric.small {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.value {
|
||||
font-size: 20px;
|
||||
font-weight: 300;
|
||||
color: var(--accent-teal);
|
||||
}
|
||||
|
||||
.bar {
|
||||
width: 100%;
|
||||
height: 8px;
|
||||
background: #555;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.bar-fill {
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, var(--accent-green), var(--accent-red));
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
|
||||
.scale {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 10px;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.fan-speed select {
|
||||
width: 100%;
|
||||
padding: 8px;
|
||||
background: var(--bg-secondary);
|
||||
color: var(--text-primary);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.band-info {
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
.band-label {
|
||||
font-size: 11px;
|
||||
@@ -694,6 +489,4 @@ async function setFanMode(mode) {
|
||||
border-color: var(--accent-cyan);
|
||||
box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.2);
|
||||
}
|
||||
=======
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
</style>
|
||||
@@ -1,5 +1,4 @@
|
||||
<script>
|
||||
<<<<<<< HEAD
|
||||
import { api } from '../lib/api.js';
|
||||
|
||||
export let status;
|
||||
@@ -27,163 +26,19 @@
|
||||
async function rotateCW() {
|
||||
try {
|
||||
await api.rotator.rotateCW();
|
||||
=======
|
||||
import { onMount } from 'svelte';
|
||||
import { api } from '../lib/api.js';
|
||||
|
||||
export let status;
|
||||
|
||||
$: rotator1 = status?.rotator1 || {};
|
||||
$: rotator2 = status?.rotator2 || {};
|
||||
$: currentHeading = rotator1.current_azimuth || 0;
|
||||
$: targetHeading = rotator1.target_azimuth || 0;
|
||||
$: moving = rotator1.moving || 0;
|
||||
$: connected = rotator1.connected || false;
|
||||
|
||||
let targetInput = currentHeading;
|
||||
let canvas;
|
||||
let ctx;
|
||||
|
||||
onMount(() => {
|
||||
if (canvas) {
|
||||
ctx = canvas.getContext('2d');
|
||||
drawGlobe();
|
||||
}
|
||||
});
|
||||
|
||||
$: if (ctx && currentHeading !== undefined) {
|
||||
drawGlobe();
|
||||
}
|
||||
|
||||
function drawGlobe() {
|
||||
if (!ctx) return;
|
||||
|
||||
const width = canvas.width;
|
||||
const height = canvas.height;
|
||||
const centerX = width / 2;
|
||||
const centerY = height / 2;
|
||||
const radius = Math.min(width, height) / 2 - 20;
|
||||
|
||||
// Clear canvas
|
||||
ctx.clearRect(0, 0, width, height);
|
||||
|
||||
// Draw globe circle
|
||||
ctx.beginPath();
|
||||
ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI);
|
||||
ctx.strokeStyle = '#444';
|
||||
ctx.lineWidth = 2;
|
||||
ctx.stroke();
|
||||
|
||||
// Draw grid lines (latitude/longitude)
|
||||
ctx.strokeStyle = '#333';
|
||||
ctx.lineWidth = 1;
|
||||
|
||||
// Latitude lines
|
||||
for (let i = 1; i < 4; i++) {
|
||||
const y = centerY - radius + (radius * 2 * i / 4);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(centerX - radius, y);
|
||||
ctx.lineTo(centerX + radius, y);
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
// Longitude lines
|
||||
for (let i = 1; i < 4; i++) {
|
||||
const x = centerX - radius + (radius * 2 * i / 4);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(x, centerY - radius);
|
||||
ctx.lineTo(x, centerY + radius);
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
// Draw cardinal directions
|
||||
ctx.fillStyle = '#888';
|
||||
ctx.font = '14px Roboto';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
|
||||
ctx.fillText('N', centerX, centerY - radius - 10);
|
||||
ctx.fillText('S', centerX, centerY + radius + 10);
|
||||
ctx.fillText('E', centerX + radius + 10, centerY);
|
||||
ctx.fillText('W', centerX - radius - 10, centerY);
|
||||
|
||||
// Draw heading indicator
|
||||
const angle = (currentHeading - 90) * Math.PI / 180;
|
||||
const lineLength = radius - 10;
|
||||
const endX = centerX + Math.cos(angle) * lineLength;
|
||||
const endY = centerY + Math.sin(angle) * lineLength;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(centerX, centerY);
|
||||
ctx.lineTo(endX, endY);
|
||||
ctx.strokeStyle = '#00bcd4';
|
||||
ctx.lineWidth = 3;
|
||||
ctx.stroke();
|
||||
|
||||
// Draw arrow head
|
||||
const arrowSize = 15;
|
||||
const arrowAngle1 = angle + Math.PI * 0.85;
|
||||
const arrowAngle2 = angle - Math.PI * 0.85;
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(endX, endY);
|
||||
ctx.lineTo(endX + Math.cos(arrowAngle1) * arrowSize, endY + Math.sin(arrowAngle1) * arrowSize);
|
||||
ctx.moveTo(endX, endY);
|
||||
ctx.lineTo(endX + Math.cos(arrowAngle2) * arrowSize, endY + Math.sin(arrowAngle2) * arrowSize);
|
||||
ctx.strokeStyle = '#00bcd4';
|
||||
ctx.lineWidth = 3;
|
||||
ctx.stroke();
|
||||
|
||||
// Draw center dot
|
||||
ctx.beginPath();
|
||||
ctx.arc(centerX, centerY, 5, 0, 2 * Math.PI);
|
||||
ctx.fillStyle = '#f44336';
|
||||
ctx.fill();
|
||||
}
|
||||
|
||||
async function moveToHeading() {
|
||||
const heading = parseInt(targetInput);
|
||||
if (isNaN(heading) || heading < 0 || heading > 360) {
|
||||
alert('Please enter a valid heading (0-360)');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await api.rotator.move(1, heading);
|
||||
} catch (err) {
|
||||
console.error('Failed to move rotator:', err);
|
||||
alert('Failed to move rotator');
|
||||
}
|
||||
}
|
||||
|
||||
async function rotateCW() {
|
||||
try {
|
||||
await api.rotator.cw(1);
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
} catch (err) {
|
||||
console.error('Failed to rotate CW:', err);
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
async function rotateCCW() {
|
||||
try {
|
||||
await api.rotator.rotateCCW();
|
||||
=======
|
||||
|
||||
async function rotateCCW() {
|
||||
try {
|
||||
await api.rotator.ccw(1);
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
} catch (err) {
|
||||
console.error('Failed to rotate CCW:', err);
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
async function stop() {
|
||||
try {
|
||||
await api.rotator.stop();
|
||||
@@ -191,7 +46,6 @@
|
||||
console.error('Failed to stop:', err);
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
</script>
|
||||
|
||||
<div class="card">
|
||||
@@ -209,7 +63,7 @@
|
||||
|
||||
<!-- Map with Beam -->
|
||||
<div class="map-container">
|
||||
<svg viewBox="0 0 500 500" class="map-svg">
|
||||
<svg viewBox="0 0 300 300" class="map-svg">
|
||||
<defs>
|
||||
<!-- Gradient for beam -->
|
||||
<radialGradient id="beamGradient">
|
||||
@@ -219,137 +73,59 @@
|
||||
</defs>
|
||||
|
||||
<!-- Ocean background -->
|
||||
<circle cx="250" cy="250" r="240" fill="rgba(30, 64, 175, 0.2)" stroke="rgba(79, 195, 247, 0.4)" stroke-width="3"/>
|
||||
|
||||
<!-- Simplified world map (Azimuthal centered on France ~46°N 6°E) -->
|
||||
<g transform="translate(250, 250)" opacity="0.5">
|
||||
|
||||
<!-- Europe (enlarged and centered) -->
|
||||
<!-- France -->
|
||||
<path d="M -20,-15 L -15,-25 L -5,-28 L 5,-25 L 10,-18 L 8,-8 L 0,-5 L -10,-8 L -18,-12 Z"
|
||||
fill="#4CAF50" stroke="#81C784" stroke-width="1.5"/>
|
||||
|
||||
<!-- Spain/Portugal -->
|
||||
<path d="M -30,-8 L -22,-12 L -18,-8 L -20,0 L -25,5 L -32,3 L -35,-2 Z"
|
||||
fill="#4CAF50" stroke="#81C784" stroke-width="1.5"/>
|
||||
|
||||
<!-- Italy -->
|
||||
<path d="M 5,-10 L 10,-12 L 15,-8 L 18,5 L 15,15 L 10,12 L 8,0 Z"
|
||||
fill="#4CAF50" stroke="#81C784" stroke-width="1.5"/>
|
||||
|
||||
<!-- Germany/Central Europe -->
|
||||
<path d="M -5,-28 L 5,-32 L 15,-30 L 20,-22 L 15,-18 L 5,-20 L 0,-25 Z"
|
||||
fill="#4CAF50" stroke="#81C784" stroke-width="1.5"/>
|
||||
|
||||
<!-- UK/Ireland -->
|
||||
<path d="M -45,-25 L -40,-32 L -32,-35 L -28,-28 L -32,-20 L -40,-22 Z"
|
||||
fill="#4CAF50" stroke="#81C784" stroke-width="1.5"/>
|
||||
|
||||
<!-- Scandinavia -->
|
||||
<path d="M 0,-40 L 10,-50 L 20,-48 L 25,-38 L 20,-32 L 10,-35 L 5,-38 Z"
|
||||
fill="#66BB6A" stroke="#81C784" stroke-width="1.5"/>
|
||||
|
||||
<!-- Eastern Europe/Russia West -->
|
||||
<path d="M 20,-35 L 35,-40 L 50,-35 L 55,-20 L 50,-10 L 35,-8 L 25,-15 Z"
|
||||
fill="#66BB6A" stroke="#81C784" stroke-width="1.5"/>
|
||||
|
||||
<!-- North Africa -->
|
||||
<path d="M -35,10 L -20,8 L 0,12 L 15,18 L 10,35 L -5,40 L -25,35 L -35,25 Z"
|
||||
fill="#FFA726" stroke="#FFB74D" stroke-width="1.5"/>
|
||||
|
||||
<!-- Sub-Saharan Africa -->
|
||||
<path d="M -20,42 L 0,45 L 15,50 L 20,70 L 10,95 L -10,100 L -30,90 L -35,70 L -30,50 Z"
|
||||
fill="#FF9800" stroke="#FFB74D" stroke-width="1.5"/>
|
||||
|
||||
<!-- Middle East -->
|
||||
<path d="M 25,0 L 40,5 L 55,10 L 60,25 L 55,38 L 42,42 L 30,35 L 22,20 Z"
|
||||
fill="#FFEB3B" stroke="#FFF176" stroke-width="1.5"/>
|
||||
|
||||
<!-- Russia East/Central Asia -->
|
||||
<path d="M 60,-30 L 90,-35 L 120,-25 L 135,-10 L 140,15 L 130,30 L 105,35 L 80,28 L 65,10 L 62,-10 Z"
|
||||
fill="#AB47BC" stroke="#BA68C8" stroke-width="1.5"/>
|
||||
|
||||
<!-- India/South Asia -->
|
||||
<path d="M 70,40 L 85,38 L 95,45 L 98,60 L 92,75 L 78,80 L 68,72 L 65,55 Z"
|
||||
fill="#EC407A" stroke="#F06292" stroke-width="1.5"/>
|
||||
|
||||
<!-- China/East Asia -->
|
||||
<path d="M 110,0 L 135,5 L 150,18 L 155,35 L 145,52 L 125,58 L 105,50 L 95,32 L 100,15 Z"
|
||||
fill="#7E57C2" stroke="#9575CD" stroke-width="1.5"/>
|
||||
|
||||
<!-- Japan -->
|
||||
<path d="M 165,25 L 172,22 L 178,28 L 175,40 L 168,45 L 162,42 L 160,32 Z"
|
||||
fill="#E91E63" stroke="#F06292" stroke-width="1.5"/>
|
||||
|
||||
<!-- North America -->
|
||||
<path d="M -140,-40 L -110,-50 L -80,-48 L -60,-35 L -55,-15 L -65,5 L -85,15 L -110,12 L -135,-5 L -145,-25 Z"
|
||||
fill="#42A5F5" stroke="#64B5F6" stroke-width="1.5"/>
|
||||
|
||||
<!-- Central America -->
|
||||
<path d="M -75,20 L -65,18 L -55,25 L -58,35 L -68,38 L -78,32 Z"
|
||||
fill="#29B6F6" stroke="#4FC3F7" stroke-width="1.5"/>
|
||||
|
||||
<!-- South America -->
|
||||
<path d="M -70,45 L -60,42 L -48,50 L -45,70 L -50,100 L -60,120 L -75,125 L -88,115 L -92,90 L -85,65 L -78,52 Z"
|
||||
fill="#26C6DA" stroke="#4DD0E1" stroke-width="1.5"/>
|
||||
|
||||
<!-- Australia -->
|
||||
<path d="M 130,95 L 155,92 L 175,100 L 180,120 L 170,135 L 145,138 L 125,128 L 122,110 Z"
|
||||
fill="#66BB6A" stroke="#81C784" stroke-width="1.5"/>
|
||||
|
||||
</g>
|
||||
<circle cx="150" cy="150" r="140" fill="rgba(30, 64, 175, 0.15)" stroke="rgba(79, 195, 247, 0.4)" stroke-width="2"/>
|
||||
|
||||
<!-- Distance circles -->
|
||||
<circle cx="250" cy="250" r="180" fill="none" stroke="rgba(79,195,247,0.2)" stroke-width="1" stroke-dasharray="4,4"/>
|
||||
<circle cx="250" cy="250" r="120" fill="none" stroke="rgba(79,195,247,0.2)" stroke-width="1" stroke-dasharray="4,4"/>
|
||||
<circle cx="250" cy="250" r="60" fill="none" stroke="rgba(79,195,247,0.2)" stroke-width="1" stroke-dasharray="4,4"/>
|
||||
<circle cx="150" cy="150" r="105" fill="none" stroke="rgba(79,195,247,0.2)" stroke-width="1" stroke-dasharray="3,3"/>
|
||||
<circle cx="150" cy="150" r="70" fill="none" stroke="rgba(79,195,247,0.2)" stroke-width="1" stroke-dasharray="3,3"/>
|
||||
<circle cx="150" cy="150" r="35" fill="none" stroke="rgba(79,195,247,0.2)" stroke-width="1" stroke-dasharray="3,3"/>
|
||||
|
||||
<!-- Rotated group for beam -->
|
||||
<g transform="translate(250, 250)">
|
||||
<g transform="translate(150, 150)">
|
||||
<!-- Beam (rotates with heading) -->
|
||||
<g transform="rotate({heading})">
|
||||
<!-- Beam sector (±15° = 30° total beamwidth) -->
|
||||
<path d="M 0,0 L {-Math.sin(15 * Math.PI/180) * 220},{-Math.cos(15 * Math.PI/180) * 220}
|
||||
A 220,220 0 0,1 {Math.sin(15 * Math.PI/180) * 220},{-Math.cos(15 * Math.PI/180) * 220} Z"
|
||||
<path d="M 0,0 L {-Math.sin(15 * Math.PI/180) * 130},{-Math.cos(15 * Math.PI/180) * 130}
|
||||
A 130,130 0 0,1 {Math.sin(15 * Math.PI/180) * 130},{-Math.cos(15 * Math.PI/180) * 130} Z"
|
||||
fill="url(#beamGradient)"
|
||||
opacity="0.85"/>
|
||||
|
||||
<!-- Beam outline -->
|
||||
<line x1="0" y1="0" x2={-Math.sin(15 * Math.PI/180) * 220} y2={-Math.cos(15 * Math.PI/180) * 220}
|
||||
stroke="#4fc3f7" stroke-width="3" opacity="0.9"/>
|
||||
<line x1="0" y1="0" x2={Math.sin(15 * Math.PI/180) * 220} y2={-Math.cos(15 * Math.PI/180) * 220}
|
||||
stroke="#4fc3f7" stroke-width="3" opacity="0.9"/>
|
||||
<line x1="0" y1="0" x2={-Math.sin(15 * Math.PI/180) * 130} y2={-Math.cos(15 * Math.PI/180) * 130}
|
||||
stroke="#4fc3f7" stroke-width="2" opacity="0.9"/>
|
||||
<line x1="0" y1="0" x2={Math.sin(15 * Math.PI/180) * 130} y2={-Math.cos(15 * Math.PI/180) * 130}
|
||||
stroke="#4fc3f7" stroke-width="2" opacity="0.9"/>
|
||||
|
||||
<!-- Direction arrow -->
|
||||
<g transform="translate(0, -190)">
|
||||
<polygon points="0,-30 -12,8 0,0 12,8"
|
||||
<g transform="translate(0, -110)">
|
||||
<polygon points="0,-20 -8,5 0,0 8,5"
|
||||
fill="#4fc3f7"
|
||||
stroke="#0288d1"
|
||||
stroke-width="3"
|
||||
style="filter: drop-shadow(0 0 15px rgba(79, 195, 247, 1))"/>
|
||||
stroke-width="2"
|
||||
style="filter: drop-shadow(0 0 10px rgba(79, 195, 247, 1))"/>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- Center dot (your QTH - JN36dg) -->
|
||||
<circle cx="0" cy="0" r="6" fill="#f44336" stroke="#fff" stroke-width="3">
|
||||
<animate attributeName="r" values="6;9;6" dur="2s" repeatCount="indefinite"/>
|
||||
<circle cx="0" cy="0" r="5" fill="#f44336" stroke="#fff" stroke-width="2">
|
||||
<animate attributeName="r" values="5;7;5" dur="2s" repeatCount="indefinite"/>
|
||||
</circle>
|
||||
<circle cx="0" cy="0" r="12" fill="none" stroke="#f44336" stroke-width="2" opacity="0.5">
|
||||
<animate attributeName="r" values="12;20;12" dur="2s" repeatCount="indefinite"/>
|
||||
<circle cx="0" cy="0" r="10" fill="none" stroke="#f44336" stroke-width="1.5" opacity="0.5">
|
||||
<animate attributeName="r" values="10;16;10" dur="2s" repeatCount="indefinite"/>
|
||||
<animate attributeName="opacity" values="0.5;0;0.5" dur="2s" repeatCount="indefinite"/>
|
||||
</circle>
|
||||
</g>
|
||||
|
||||
<!-- Cardinal points -->
|
||||
<text x="250" y="30" text-anchor="middle" class="cardinal">N</text>
|
||||
<text x="470" y="255" text-anchor="middle" class="cardinal">E</text>
|
||||
<text x="250" y="480" text-anchor="middle" class="cardinal">S</text>
|
||||
<text x="30" y="255" text-anchor="middle" class="cardinal">W</text>
|
||||
<text x="150" y="20" text-anchor="middle" class="cardinal">N</text>
|
||||
<text x="280" y="155" text-anchor="middle" class="cardinal">E</text>
|
||||
<text x="150" y="285" text-anchor="middle" class="cardinal">S</text>
|
||||
<text x="20" y="155" text-anchor="middle" class="cardinal">W</text>
|
||||
|
||||
<!-- Degree markers every 30° -->
|
||||
{#each [30, 60, 120, 150, 210, 240, 300, 330] as angle}
|
||||
{@const x = 250 + 215 * Math.sin(angle * Math.PI / 180)}
|
||||
{@const y = 250 - 215 * Math.cos(angle * Math.PI / 180)}
|
||||
<!-- Degree markers every 45° -->
|
||||
{#each [45, 135, 225, 315] as angle}
|
||||
{@const x = 150 + 125 * Math.sin(angle * Math.PI / 180)}
|
||||
{@const y = 150 - 125 * Math.cos(angle * Math.PI / 180)}
|
||||
<text x={x} y={y} text-anchor="middle" dominant-baseline="middle" class="degree-label">{angle}°</text>
|
||||
{/each}
|
||||
</svg>
|
||||
@@ -467,7 +243,7 @@
|
||||
|
||||
.map-svg {
|
||||
width: 100%;
|
||||
max-width: 500px;
|
||||
max-width: 300px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
@@ -569,187 +345,5 @@
|
||||
.arrow {
|
||||
font-size: 20px;
|
||||
line-height: 1;
|
||||
=======
|
||||
|
||||
// Preset directions
|
||||
const presets = [
|
||||
{ name: 'EU-0', heading: 0 },
|
||||
{ name: 'JA-35', heading: 35 },
|
||||
{ name: 'AS-75', heading: 75 },
|
||||
{ name: 'VK-120', heading: 120 },
|
||||
{ name: 'AF-180', heading: 180 },
|
||||
{ name: 'SA-230', heading: 230 },
|
||||
{ name: 'WI-270', heading: 270 },
|
||||
{ name: 'NA-300', heading: 300 }
|
||||
];
|
||||
|
||||
async function gotoPreset(heading) {
|
||||
try {
|
||||
await api.rotator.move(1, heading);
|
||||
} catch (err) {
|
||||
console.error('Failed to move to preset:', err);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="rotator-card card">
|
||||
<h2>
|
||||
ROTATOR GENIUS
|
||||
<span class="status-indicator" class:status-online={connected} class:status-offline={!connected}></span>
|
||||
</h2>
|
||||
|
||||
<div class="heading-display">
|
||||
CURRENT HEADING: <span class="heading-value">{currentHeading}°</span>
|
||||
</div>
|
||||
|
||||
{#if moving > 0}
|
||||
<div class="moving-indicator">
|
||||
{moving === 1 ? '↻ ROTATING CW' : '↺ ROTATING CCW'}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<canvas bind:this={canvas} width="300" height="300"></canvas>
|
||||
|
||||
<div class="controls">
|
||||
<div class="heading-input">
|
||||
<input
|
||||
type="number"
|
||||
min="0"
|
||||
max="360"
|
||||
bind:value={targetInput}
|
||||
placeholder="Enter heading"
|
||||
/>
|
||||
<button class="btn btn-primary" on:click={moveToHeading}>GO</button>
|
||||
</div>
|
||||
|
||||
<div class="rotation-controls">
|
||||
<button class="btn btn-secondary" on:click={rotateCCW}>↺ CCW</button>
|
||||
<button class="btn btn-danger" on:click={stop}>STOP</button>
|
||||
<button class="btn btn-secondary" on:click={rotateCW}>CW ↻</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="presets">
|
||||
{#each presets as preset}
|
||||
<button
|
||||
class="preset-btn"
|
||||
class:active={Math.abs(currentHeading - preset.heading) < 5}
|
||||
on:click={() => gotoPreset(preset.heading)}
|
||||
>
|
||||
{preset.name}
|
||||
</button>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.rotator-card {
|
||||
min-width: 350px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 16px;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: var(--accent-teal);
|
||||
}
|
||||
|
||||
.heading-display {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
margin-bottom: 8px;
|
||||
padding: 12px;
|
||||
background: var(--bg-secondary);
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.heading-value {
|
||||
color: var(--accent-blue);
|
||||
font-size: 24px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.moving-indicator {
|
||||
text-align: center;
|
||||
padding: 8px;
|
||||
background: var(--accent-green);
|
||||
color: white;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 12px;
|
||||
font-weight: 500;
|
||||
animation: pulse 1.5s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.7; }
|
||||
}
|
||||
|
||||
canvas {
|
||||
display: block;
|
||||
margin: 16px auto;
|
||||
background: var(--bg-secondary);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.controls {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.heading-input {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.heading-input input {
|
||||
flex: 1;
|
||||
padding: 12px;
|
||||
background: var(--bg-secondary);
|
||||
color: var(--text-primary);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 4px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.rotation-controls {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.rotation-controls button {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.presets {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.preset-btn {
|
||||
padding: 12px 8px;
|
||||
background: var(--accent-blue);
|
||||
color: white;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.preset-btn:hover {
|
||||
background: #1976d2;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.preset-btn.active {
|
||||
background: var(--accent-green);
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,5 @@
|
||||
<script>
|
||||
import { api } from '../lib/api.js';
|
||||
<<<<<<< HEAD
|
||||
|
||||
export let status;
|
||||
|
||||
@@ -44,53 +43,10 @@
|
||||
} catch (err) {
|
||||
console.error('Failed to set operate:', err);
|
||||
alert('Failed to set operate');
|
||||
=======
|
||||
|
||||
export let status;
|
||||
|
||||
$: operate = status?.operate || false;
|
||||
$: activeAntenna = status?.active_antenna || 0;
|
||||
$: tuningStatus = status?.tuning_status || 'READY';
|
||||
$: frequencyA = status?.frequency_a || 0;
|
||||
$: frequencyB = status?.frequency_b || 0;
|
||||
$: c1 = status?.c1 || 0;
|
||||
$: l = status?.l || 0;
|
||||
$: c2 = status?.c2 || 0;
|
||||
$: connected = status?.connected || false;
|
||||
|
||||
let tuning = false;
|
||||
|
||||
async function toggleOperate() {
|
||||
try {
|
||||
await api.tuner.operate(!operate);
|
||||
} catch (err) {
|
||||
console.error('Failed to toggle operate:', err);
|
||||
}
|
||||
}
|
||||
|
||||
async function startTune() {
|
||||
tuning = true;
|
||||
try {
|
||||
await api.tuner.tune();
|
||||
} catch (err) {
|
||||
console.error('Failed to tune:', err);
|
||||
alert('Tuning failed');
|
||||
} finally {
|
||||
tuning = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function setAntenna(ant) {
|
||||
try {
|
||||
await api.tuner.antenna(ant);
|
||||
} catch (err) {
|
||||
console.error('Failed to set antenna:', err);
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<<<<<<< HEAD
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>Tuner Genius XL</h2>
|
||||
@@ -484,218 +440,10 @@
|
||||
border-color: var(--accent-cyan);
|
||||
color: #000;
|
||||
box-shadow: 0 0 15px rgba(79, 195, 247, 0.5);
|
||||
=======
|
||||
<div class="tuner-card card">
|
||||
<h2>
|
||||
TGXL
|
||||
<span class="status-indicator" class:status-online={connected} class:status-offline={!connected}></span>
|
||||
</h2>
|
||||
|
||||
<div class="power-status">
|
||||
<div class="label">Power 0.0w</div>
|
||||
<div class="status-badge">1500</div>
|
||||
<div class="status-badge">1650</div>
|
||||
</div>
|
||||
|
||||
<div class="tuning-controls">
|
||||
<div class="tuning-row">
|
||||
<div class="tuning-label">TG XL SWR 1.00 use</div>
|
||||
</div>
|
||||
|
||||
<div class="antenna-buttons">
|
||||
<button
|
||||
class="antenna-btn"
|
||||
class:active={activeAntenna === 0}
|
||||
on:click={() => setAntenna(0)}
|
||||
>
|
||||
C1
|
||||
</button>
|
||||
<button
|
||||
class="antenna-btn"
|
||||
class:active={activeAntenna === 1}
|
||||
on:click={() => setAntenna(1)}
|
||||
>
|
||||
L
|
||||
</button>
|
||||
<button
|
||||
class="antenna-btn"
|
||||
class:active={activeAntenna === 2}
|
||||
on:click={() => setAntenna(2)}
|
||||
>
|
||||
C2
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="tuning-values">
|
||||
<div class="value-box">
|
||||
<div class="value">{c1}</div>
|
||||
<div class="label">C1</div>
|
||||
</div>
|
||||
<div class="value-box">
|
||||
<div class="value">{l}</div>
|
||||
<div class="label">L</div>
|
||||
</div>
|
||||
<div class="value-box">
|
||||
<div class="value">{c2}</div>
|
||||
<div class="label">C2</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="status-row">
|
||||
<div class="metric">
|
||||
<div class="label">Tuning Status</div>
|
||||
<div class="status-badge" class:tuning={tuningStatus === 'TUNING'}>
|
||||
{tuningStatus}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="frequency-row">
|
||||
<div class="metric">
|
||||
<div class="label">Frequency A</div>
|
||||
<div class="value-display">{(frequencyA / 1000).toFixed(3)}</div>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<div class="label">Frequency B</div>
|
||||
<div class="value-display">{(frequencyB / 1000).toFixed(3)}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="action-buttons">
|
||||
<button
|
||||
class="btn"
|
||||
class:btn-primary={!operate}
|
||||
class:btn-danger={operate}
|
||||
on:click={toggleOperate}
|
||||
>
|
||||
{operate ? 'STANDBY' : 'OPERATE'}
|
||||
</button>
|
||||
<button class="btn btn-secondary" disabled>BYPASS</button>
|
||||
</div>
|
||||
|
||||
<button
|
||||
class="btn btn-danger tune-btn"
|
||||
disabled={tuning || !operate}
|
||||
on:click={startTune}
|
||||
>
|
||||
{tuning ? 'TUNING...' : 'TUNE'}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.tuner-card {
|
||||
min-width: 350px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 16px;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: var(--accent-teal);
|
||||
}
|
||||
|
||||
.power-status {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.status-badge {
|
||||
padding: 4px 12px;
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.status-badge.tuning {
|
||||
background: var(--accent-green);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.tuning-controls {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.tuning-label {
|
||||
font-size: 12px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.antenna-buttons {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
.antenna-btn {
|
||||
flex: 1;
|
||||
padding: 12px;
|
||||
background: var(--bg-secondary);
|
||||
color: var(--text-primary);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 4px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.antenna-btn.active {
|
||||
background: var(--accent-blue);
|
||||
border-color: var(--accent-blue);
|
||||
}
|
||||
|
||||
.tuning-values {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin: 16px 0;
|
||||
}
|
||||
|
||||
.value-box {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
padding: 12px;
|
||||
background: var(--bg-secondary);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.value-box .value {
|
||||
font-size: 20px;
|
||||
font-weight: 300;
|
||||
color: var(--accent-teal);
|
||||
}
|
||||
|
||||
.status-row {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.frequency-row {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.metric {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.action-buttons button {
|
||||
flex: 1;
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
}
|
||||
|
||||
.tune-btn {
|
||||
width: 100%;
|
||||
<<<<<<< HEAD
|
||||
padding: 14px;
|
||||
border-radius: 6px;
|
||||
font-size: 13px;
|
||||
@@ -725,7 +473,5 @@
|
||||
|
||||
.tune-icon {
|
||||
font-size: 18px;
|
||||
=======
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
}
|
||||
</style>
|
||||
@@ -4,10 +4,7 @@
|
||||
export let status;
|
||||
|
||||
$: relays = status?.relays || [];
|
||||
<<<<<<< HEAD
|
||||
$: connected = status?.connected || false;
|
||||
=======
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
|
||||
const relayNames = {
|
||||
1: 'Power Supply',
|
||||
@@ -55,7 +52,6 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<<<<<<< HEAD
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2>WebSwitch</h2>
|
||||
@@ -99,40 +95,10 @@
|
||||
ALL OFF
|
||||
</button>
|
||||
</div>
|
||||
=======
|
||||
<div class="webswitch-card card">
|
||||
<h2>
|
||||
1216RH
|
||||
<span class="status-indicator" class:status-online={relays.length > 0} class:status-offline={relays.length === 0}></span>
|
||||
</h2>
|
||||
|
||||
<div class="relays">
|
||||
{#each [1, 2, 3, 4, 5] as relayNum}
|
||||
{@const relay = relays.find(r => r.number === relayNum)}
|
||||
{@const isOn = relay?.state || false}
|
||||
<div class="relay-row">
|
||||
<span class="relay-name">{relayNames[relayNum]}</span>
|
||||
<button
|
||||
class="relay-toggle"
|
||||
class:active={isOn}
|
||||
disabled={loading[relayNum]}
|
||||
on:click={() => toggleRelay(relayNum)}
|
||||
>
|
||||
<div class="toggle-icon"></div>
|
||||
</button>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<div class="controls">
|
||||
<button class="btn btn-primary" on:click={allOn}>ALL ON</button>
|
||||
<button class="btn btn-danger" on:click={allOff}>ALL OFF</button>
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
<<<<<<< HEAD
|
||||
.card {
|
||||
background: linear-gradient(135deg, #1a2332 0%, #0f1923 100%);
|
||||
border: 1px solid #2d3748;
|
||||
@@ -335,73 +301,5 @@
|
||||
|
||||
.all-off:hover {
|
||||
box-shadow: 0 6px 16px rgba(244, 67, 54, 0.5);
|
||||
=======
|
||||
.webswitch-card {
|
||||
min-width: 280px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 20px;
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
color: var(--accent-teal);
|
||||
}
|
||||
|
||||
.relays {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.relay-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.relay-name {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.relay-toggle {
|
||||
width: 60px;
|
||||
height: 32px;
|
||||
background: #555;
|
||||
border-radius: 16px;
|
||||
position: relative;
|
||||
transition: background 0.3s ease;
|
||||
}
|
||||
|
||||
.relay-toggle.active {
|
||||
background: var(--accent-green);
|
||||
}
|
||||
|
||||
.toggle-icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
background: white;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
left: 4px;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.relay-toggle.active .toggle-icon {
|
||||
transform: translateX(28px);
|
||||
}
|
||||
|
||||
.controls {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.controls button {
|
||||
flex: 1;
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
}
|
||||
</style>
|
||||
@@ -47,7 +47,6 @@ export const api = {
|
||||
|
||||
// Tuner
|
||||
tuner: {
|
||||
<<<<<<< HEAD
|
||||
setOperate: (value) => request('/tuner/operate', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ value }),
|
||||
@@ -57,33 +56,15 @@ export const api = {
|
||||
body: JSON.stringify({ value }),
|
||||
}),
|
||||
autoTune: () => request('/tuner/autotune', { method: 'POST' }),
|
||||
=======
|
||||
operate: (operate) => request('/tuner/operate', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ operate }),
|
||||
}),
|
||||
tune: () => request('/tuner/tune', { method: 'POST' }),
|
||||
antenna: (antenna) => request('/tuner/antenna', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ antenna }),
|
||||
}),
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
},
|
||||
|
||||
// Antenna Genius
|
||||
antenna: {
|
||||
<<<<<<< HEAD
|
||||
selectAntenna: (port, antenna) => request('/antenna/select', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ port, antenna }),
|
||||
}),
|
||||
reboot: () => request('/antenna/reboot', { method: 'POST' }),
|
||||
=======
|
||||
set: (radio, antenna) => request('/antenna/set', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ radio, antenna }),
|
||||
}),
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
},
|
||||
|
||||
// Power Genius
|
||||
@@ -92,7 +73,6 @@ export const api = {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ mode }),
|
||||
}),
|
||||
<<<<<<< HEAD
|
||||
setOperate: (value) => request('/power/operate', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ value }),
|
||||
@@ -108,7 +88,5 @@ export const api = {
|
||||
rotateCW: () => request('/rotator/cw', { method: 'POST' }),
|
||||
rotateCCW: () => request('/rotator/ccw', { method: 'POST' }),
|
||||
stop: () => request('/rotator/stop', { method: 'POST' }),
|
||||
=======
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
},
|
||||
};
|
||||
@@ -28,10 +28,7 @@ class WebSocketService {
|
||||
const message = JSON.parse(event.data);
|
||||
|
||||
if (message.type === 'update') {
|
||||
<<<<<<< HEAD
|
||||
console.log('System status updated:', message.data);
|
||||
=======
|
||||
>>>>>>> 4ab192418e21065c68d59777493ea03b76c061e7
|
||||
systemStatus.set(message.data);
|
||||
lastUpdate.set(new Date(message.timestamp));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user