mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Merge branch 'main' of https://github.com/Pax1601/DCSOlympus into unit-list
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
# Important note: DCS Olympus is in alpha state. No official release has been produced yet. The first public version is planned for Q2 2023.
|
||||||
|
|
||||||
# DCS Olympus
|
# DCS Olympus
|
||||||
*A real-time web interface to spawn and control units in DCS World*
|
*A real-time web interface to spawn and control units in DCS World*
|
||||||
|
|
||||||
|
|||||||
@@ -1,87 +0,0 @@
|
|||||||
import { ToggleableFeature } from "../toggleablefeature";
|
|
||||||
import Sortable from 'sortablejs';
|
|
||||||
import { ATCFLightList } from "./flightlist";
|
|
||||||
|
|
||||||
export class ATC extends ToggleableFeature {
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
|
|
||||||
super( true );
|
|
||||||
|
|
||||||
//this.#generateFlightList();
|
|
||||||
|
|
||||||
let $list = document.getElementById( "atc-strip-board-arrivals" );
|
|
||||||
|
|
||||||
if ( $list instanceof HTMLElement ) {
|
|
||||||
Sortable.create( $list, {
|
|
||||||
"handle": ".handle"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#generateFlightList() {
|
|
||||||
|
|
||||||
const flightList = new ATCFLightList();
|
|
||||||
const flights:any = flightList.getFlights( true );
|
|
||||||
|
|
||||||
const $tbody = document.getElementById( "atc-flight-list-table-body" );
|
|
||||||
|
|
||||||
if ( $tbody instanceof HTMLElement ) {
|
|
||||||
|
|
||||||
if ( flights.length > 0 ) {
|
|
||||||
|
|
||||||
let flight:any = {};
|
|
||||||
|
|
||||||
let $button, i;
|
|
||||||
|
|
||||||
for ( [ i, flight ] of flights.entries() ) {
|
|
||||||
|
|
||||||
const $row = document.createElement( "tr" );
|
|
||||||
$row.dataset.status = flight.status
|
|
||||||
|
|
||||||
let $td = document.createElement( "td" );
|
|
||||||
$td.innerText = flight.name;
|
|
||||||
$row.appendChild( $td );
|
|
||||||
|
|
||||||
$td = document.createElement( "td" );
|
|
||||||
$td.innerText = flight.takeOffTime;
|
|
||||||
$row.appendChild( $td );
|
|
||||||
|
|
||||||
$td = document.createElement( "td" );
|
|
||||||
$td.innerText = "00:0" + ( 5 + i );
|
|
||||||
$row.appendChild( $td );
|
|
||||||
|
|
||||||
$td = document.createElement( "td" );
|
|
||||||
$td.innerText = flight.status;
|
|
||||||
$row.appendChild( $td );
|
|
||||||
|
|
||||||
|
|
||||||
$td = document.createElement( "td" );
|
|
||||||
$button = document.createElement( "button" );
|
|
||||||
$button.innerText = "...";
|
|
||||||
|
|
||||||
$td.appendChild( $button );
|
|
||||||
|
|
||||||
$row.appendChild( $td );
|
|
||||||
|
|
||||||
|
|
||||||
$tbody.appendChild( $row );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
protected onStatusUpdate(): void {
|
|
||||||
|
|
||||||
document.body.classList.toggle( "atc-enabled", this.getStatus() );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
export abstract class ATCMockAPI {
|
|
||||||
|
|
||||||
constructor() {}
|
|
||||||
|
|
||||||
generateMockData() {}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
import { ATCMockAPI } from "../atcmockapi";
|
|
||||||
|
|
||||||
export class ATCMockAPI_Flights extends ATCMockAPI {
|
|
||||||
|
|
||||||
|
|
||||||
generateMockData() {
|
|
||||||
|
|
||||||
let data = [];
|
|
||||||
const statuses = [ "unknown", "checkedIn", "readyToTaxi" ]
|
|
||||||
|
|
||||||
for ( const [ i, flightName ] of [ "Shark", "Whale", "Dolphin" ].entries() ) {
|
|
||||||
|
|
||||||
data.push({
|
|
||||||
"name": flightName,
|
|
||||||
"status": statuses[ i ],
|
|
||||||
"takeOffTime": "18:0" + i
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
localStorage.setItem( "flightList", JSON.stringify( data ) );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
get( generateMockDataIfEmpty?:boolean ) : object {
|
|
||||||
|
|
||||||
generateMockDataIfEmpty = generateMockDataIfEmpty || false;
|
|
||||||
|
|
||||||
let data = localStorage.getItem( "flightList" ) || "[]";
|
|
||||||
|
|
||||||
if ( data === "[]" && generateMockDataIfEmpty ) {
|
|
||||||
this.generateMockData();
|
|
||||||
}
|
|
||||||
|
|
||||||
return JSON.parse( data );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
import { ATCMockAPI_Flights } from "./atcmockapi/flights";
|
|
||||||
|
|
||||||
export class ATCFLightList {
|
|
||||||
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
getFlights( generateMockDataIfEmpty?:boolean ) {
|
|
||||||
let api = new ATCMockAPI_Flights();
|
|
||||||
return api.get( generateMockDataIfEmpty );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Binary file not shown.
@@ -1,42 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio Version 17
|
|
||||||
VisualStudioVersion = 17.3.32929.385
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core", "core\core.vcxproj", "{8A48D855-0E01-42BA-BD8C-07B0877C68DF}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logger", "logger\logger.vcxproj", "{873ECABE-FCFE-4217-AC15-91959C3CF1C6}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dcstools", "dcstools\dcstools.vcxproj", "{2B255368-39A0-431A-A6DE-CC739AC70DC1}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "luatools", "luatools\luatools.vcxproj", "{DE139EC1-4F88-47D5-BE73-F41915FE14A3}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "utils", "utils\utils.vcxproj", "{B85009CE-4A5C-4A5A-B85D-001B3A2651B2}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "olympus", "olympus\olympus.vcxproj", "{5F3FC91E-1FBC-4223-8011-9708DE913474}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Release|x64 = Release|x64
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{8A48D855-0E01-42BA-BD8C-07B0877C68DF}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{8A48D855-0E01-42BA-BD8C-07B0877C68DF}.Release|x64.Build.0 = Release|x64
|
|
||||||
{873ECABE-FCFE-4217-AC15-91959C3CF1C6}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{873ECABE-FCFE-4217-AC15-91959C3CF1C6}.Release|x64.Build.0 = Release|x64
|
|
||||||
{2B255368-39A0-431A-A6DE-CC739AC70DC1}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{2B255368-39A0-431A-A6DE-CC739AC70DC1}.Release|x64.Build.0 = Release|x64
|
|
||||||
{DE139EC1-4F88-47D5-BE73-F41915FE14A3}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{DE139EC1-4F88-47D5-BE73-F41915FE14A3}.Release|x64.Build.0 = Release|x64
|
|
||||||
{B85009CE-4A5C-4A5A-B85D-001B3A2651B2}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{B85009CE-4A5C-4A5A-B85D-001B3A2651B2}.Release|x64.Build.0 = Release|x64
|
|
||||||
{5F3FC91E-1FBC-4223-8011-9708DE913474}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{5F3FC91E-1FBC-4223-8011-9708DE913474}.Release|x64.Build.0 = Release|x64
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
||||||
SolutionGuid = {FAB9F592-7511-4EB9-B365-078842ED9BDD}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
Reference in New Issue
Block a user