Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
TJKoury committed Jan 12, 2024
1 parent 072ce1b commit 81272e1
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 20 deletions.
6 changes: 3 additions & 3 deletions docs/assets/app-5f7f57f8.js → docs/assets/app-a476d12d.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<meta name="HandheldFriendly" content="true" />

<title>SDA TAP LAB</title>
<script type="module" crossorigin src="/assets/app-5f7f57f8.js"></script>
<script type="module" crossorigin src="/assets/app-a476d12d.js"></script>
<link rel="stylesheet" href="/assets/index-42a1951f.css">
</head>
<body>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "spaceaware.io",
"private": true,
"version": "0.0.0+1705015887253",
"version": "0.0.0+1705018948270",
"type": "module",
"scripts": {
"postinstall": "npm run copy:orbpro",
Expand Down
51 changes: 39 additions & 12 deletions src/lib/Camera/Modal.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<script lang="ts">
import { Cartesian3, Math as CesiumMath, DataSource, Entity } from "orbpro";
import {
Cartesian3,
Math as CesiumMath,
DataSource,
Entity,
Analysis,
Clock,
} from "orbpro";
import { messages } from "@/stores/events.store";
import { content, lastcontent } from "@/stores/modal.store";
import { scenario } from "@/stores/settings.store";
Expand All @@ -13,11 +20,13 @@
let _cameraPosition: Cartesian3 | undefined;
let _cameraPositionECEF: string[] = [];
let _cameraPositionLLA: string[] = [];
let searchFrom = "";
let searchFrom = viewer.selectedEntity?.id || "";
let searchTo = "";
let activeSearchBox = "from"; // 'from' or 'to'
let matchingEntities: Entity[] = [];
const selectedFromEntity = writable<Entity | null>(null);
const selectedFromEntity = writable<Entity | null>(
viewer.selectedEntity || null
);
const selectedToEntity = writable<Entity | null>(null);
function searchEntities(searchTerm: string): Entity[] {
Expand Down Expand Up @@ -92,12 +101,21 @@
viewer.camera.unTrack();
}
let azElRange: any = {};
onMount(() => {
_shouldAnimate = (globalThis as any).viewer!.clock.shouldAnimate;
scenario.settings.ClockSettings.shouldAnimate.set(false);
positionListener = (
globalThis as any
).viewer?.clock.onTick.addEventListener(() => {
).viewer?.clock.onTick.addEventListener((clock: Clock) => {
const { currentTime } = clock;
if ($selectedFromEntity?.position && $selectedToEntity?.position) {
azElRange = Analysis.getAzElRange(
$selectedFromEntity.position.getValue(currentTime) as Cartesian3,
$selectedToEntity.position.getValue(currentTime) as Cartesian3
);
}
_cameraPosition = (globalThis as any).viewer?.camera.positionWC;
if (_cameraPosition) {
const ellipsoid = (globalThis as any).viewer!.scene.globe.ellipsoid;
Expand Down Expand Up @@ -129,6 +147,7 @@
$content = $lastcontent || undefined;
$lastcontent = undefined;
scenario.settings.ClockSettings.shouldAnimate.set(_shouldAnimate);
clearAllTracking();
};
</script>

Expand Down Expand Up @@ -170,21 +189,29 @@
{/if}
{#if $selectedToEntity && $selectedFromEntity}
<div
class="bg-red-500 p-1 pl-2 pr-2 rounded flex items-center justify-center">
on:click={clearAllTracking}
class="bg-red-500 cursor-pointer p-1 pl-2 pr-2 rounded flex items-center justify-center">
Clear
</div>
{/if}
</div>
<div
class="flex flex-col gap-1 w-full border overflow-scroll p-2 cursor-pointer">

{#each matchingEntities as entity}
<div
class="border rounded p-2 flex items-center justify-center text-xs"
on:click={() => selectEntity(entity)}>
{entity.name}
{#if !$selectedToEntity || !$selectedFromEntity}
{#each matchingEntities as entity}
<div
class="border rounded p-2 flex items-center justify-center text-xs"
on:click={() => selectEntity(entity)}>
{entity.name}
</div>
{/each}
{:else if azElRange?.az && azElRange?.el && azElRange?.range}
<div>
<div>AZ: {azElRange.az.toFixed(2)}</div>
<div>EL: {azElRange.el.toFixed(2)}</div>
<div>RANGE: {(azElRange.range / 1000).toFixed(2)} km</div>
</div>
{/each}
{/if}
</div>
</div>
<div
Expand Down
3 changes: 1 addition & 2 deletions src/stores/entity.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ activeEntity.subscribe((aEntity: Entity | null) => {
if (aEntity instanceof SpaceEntity) {
(globalThis as any).viewer.scene.screenSpaceCameraController.minimumZoomDistance = 100.0;
template.set(SpaceObjectTemplate);
scenario.settings.referenceFrame.set(1);
//scenario.settings.referenceFrame.set(1);
} else if (aEntity.properties?.SIT) {
(globalThis as any).viewer.scene.screenSpaceCameraController.minimumZoomDistance = 10.0;
template.set(SITTemplate);
Expand All @@ -35,7 +35,6 @@ activeEntity.subscribe((aEntity: Entity | null) => {
(globalThis as any).viewer.scene.screenSpaceCameraController.minimumZoomDistance = 0.0;
title.set(undefined);
template.set(undefined);
console.log(aEntity);
}
} else {
content.set(undefined);
Expand Down
2 changes: 1 addition & 1 deletion src/stores/utilities/process.sit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const processSIT = async (viewer: Viewer, data: ExtendedSITCOLLECTIONT) =
const siteColor = siteTypeColors[record.SITE_TYPE?.toString()] || Color.WHITE;

try {
position = Cartesian3.fromDegrees(record.LONGITUDE, record.LATITUDE);
position = Cartesian3.fromDegrees(record.LONGITUDE, record.LATITUDE, 10);
} catch (e) {
console.log(JSON.stringify(record, null, 4));
//reject(e);
Expand Down

0 comments on commit 81272e1

Please sign in to comment.