Skip to content

Commit

Permalink
search anomaly works, but not perfectly, good enough I would say
Browse files Browse the repository at this point in the history
  • Loading branch information
isuretpolos committed May 4, 2024
1 parent 175474e commit c78aca9
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ jobs:
pwd;
ls -l;
ls -l target;
cp target/AetherOnePi-1.3.7.jar aetherOnePi/beta/release/;
cp target/AetherOnePi-1.3.8.jar aetherOnePi/beta/release/;
cp backgrounds/*.jpg aetherOnePi/beta/release/backgrounds/;
cp data_images/IMAGE_CHAKRAS/*.* aetherOnePi/beta/release/data_images/IMAGE_CHAKRAS/;
cp data_images/IMAGE_AURAS/*.* aetherOnePi/beta/release/data_images/IMAGE_AURAS/;
cp processing/HotbitsFromWebCam/HotbitsFromWebCam.pde aetherOnePi/beta/release/processing/HotbitsFromWebCam/;
cp start*.bat aetherOnePi/beta/release/;
- uses: actions/upload-artifact@master
with:
name: AetherOnePi-1.3.7
name: AetherOnePi-1.3.8
path: aetherOnePi/beta/release
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ A video series explaining the software will follow.
You need Java 1.8 as a runtime. Download it from [java.com](https://www.java.com/en/download/) and install it before you run the AetherOnePi application on your PC (Windows / Linux), Mac or Raspberry Pi.

## Download
Download [Version 1.3.7](https://github.com/isuretpolos/AetherOnePi/releases/tag/v1.3.7)
Download [Version 1.3.8](https://github.com/isuretpolos/AetherOnePi/releases/tag/v1.3.8)

or download the Beta which is build after each change on the [Action tab](https://github.com/isuretpolos/AetherOnePi/actions). Just click on the Build Element and in the upper right corner you will see a Artifact Download Button if the build was a success.

Subscribe to my blog(s) and join the [VK community](https://vk.com/aetherone), [Reddit](https://www.reddit.com/r/digitalradionics/) or chat with **Thalia** on [Facebook MorphicEngineering Group](https://www.facebook.com/groups/morphicengineering).

# Feature History
- 2024-04-04 Anomaly Search in the Map
- 2024-03-15 Map Analysis, browser UI
- 2024-02-17 bugfixes and experimental features that will be revealed in the next version
- 2023-07-21 watchlist.csv, notification setting, calculate rate from signature
Expand Down
2 changes: 1 addition & 1 deletion documentation/dashboardNews.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Welcome to AetherOnePi, free Radionics for everyone!!!

The most current version is the 1.3.7 with useful improvements!
The most current version is the 1.3.8 with useful improvements!

Read the documentation by clicking on the button "DOCUMENTATION".
Else join the PATREON community if you have questions and if
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<description>Open Source Radionics</description>

<properties>
<aether.version>1.3.7</aether.version>
<aether.version>1.3.8</aether.version>
<java.version>1.8</java.version>
<commons-io.version>2.7</commons-io.version>
<pi4j-core.version>1.2</pi4j-core.version>
Expand Down
4 changes: 3 additions & 1 deletion src/main/ui/src/app/components/map/map.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
<button *ngIf="lastSelectedFeature" class="btn btn-sm btn-warning toolbar-button" (click)="analyze()" title="ANALYZE">ANALYZE <i-bs name="bar-chart"></i-bs></button>
<button *ngIf="lastSelectedFeature" class="btn btn-sm btn-warning toolbar-button" (click)="searchAnomaly()" title="SEARCH">SEARCH <i-bs name="bar-chart"></i-bs></button>
<button class="btn btn-sm btn-info toolbar-button" (click)="setNavigateMode()" title="NAVIGATION MODE (NO EDIT)"><i-bs name="eye"></i-bs></button>
<!--
<a class="btn btn-sm btn-info toolbar-button" *ngIf="map" href="https://www.google.com/maps/@{{getCoordinates(map.getView().getCenter()).toString().split(',')[1]}},{{getCoordinates(map.getView().getCenter()).toString().split(',')[0]}},{{map.getView().getZoom()}}z" target="googleMaps">GoogleMaps</a>
<!--<button class="btn btn-sm btn-info toolbar-button" (click)="openGoogleEarth()">Google Earth</button>
<button *ngIf="featureModified && territoryNumberSet()" class="btn btn-sm btn-warning toolbar-button" (click)="saveMap()">SAVE MODIFICATION!</button>
<button *ngIf="featureModified && !territoryNumberSet()" class="btn btn-sm btn-warning toolbar-button" disabled>SAVE MODIFICATION!</button>
<button *ngIf="!hideImportedFeature" (click)="hideImportedFeature = !hideImportedFeature; vectorLayer.getSource().changed();" class="btn btn-sm btn-info toolbar-button" title="hide outline polygon"><i class="bi bi-easel-fill"></i></button>
Expand Down
81 changes: 67 additions & 14 deletions src/main/ui/src/app/components/map/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class MapComponent implements OnInit, AfterViewInit {
this.checkGV()
}

console.log('Key pressed:', event.key);
//console.log('Key pressed:', event.key);
}

case: Case = new Case()
Expand Down Expand Up @@ -70,7 +70,7 @@ export class MapComponent implements OnInit, AfterViewInit {
}),

text: new Text({
text: 'hello',
text: '',
font: '12px Calibri,sans-serif',
overflow: true,
fill: new Fill({
Expand All @@ -97,7 +97,8 @@ export class MapComponent implements OnInit, AfterViewInit {
fromEvent<ClipboardEvent>(document.body, 'paste').pipe(
map((event: ClipboardEvent) => event.clipboardData?.getData('text'))
).subscribe((clipboardContent: string | undefined) => {
if (clipboardContent && clipboardContent.includes('google.de/maps')) {
if (clipboardContent && (clipboardContent.includes('google.de/maps') || clipboardContent.includes('google.com/maps'))) {
console.log(clipboardContent)
const coordinates = this.extractCoordinatesFromGoogleMapsURL(clipboardContent);
if (coordinates) {
this.navigateToCoordinates(coordinates);
Expand Down Expand Up @@ -132,7 +133,11 @@ export class MapComponent implements OnInit, AfterViewInit {
this.vectorLayer = new VectorLayer({
source: this.source,
style: function (feature) {
return that.styleRedOutline;
if (feature.get("style")) {
return feature.get("style")
} else {
return that.styleRedOutline
}
}
});

Expand Down Expand Up @@ -169,13 +174,16 @@ export class MapComponent implements OnInit, AfterViewInit {

if (e.deselected) {
this.lastSelectedFeature = undefined;
console.log("deselected")
}

this.lastSelectedFeature = e.selected[0];
console.log("selected")
});
}

extractCoordinatesFromGoogleMapsURL(url: string): [number, number] | null {
console.log(url)
const match = url.match(/@(-?\d+\.\d+),(-?\d+\.\d+)/);
if (match && match.length === 3) {
const lat = parseFloat(match[1]);
Expand Down Expand Up @@ -369,29 +377,64 @@ export class MapComponent implements OnInit, AfterViewInit {
let height: number = 10;

this.aetherOnePiService.searchAnomaly(width, height).subscribe(r => {

let extent: Extent | undefined = this.lastSelectedFeature?.getGeometry()?.getExtent()
if (extent) {

if (this.lastSelectedFeature?.getGeometry()?.getType() == 'Circle') {

let radius: number = (extent[0] - extent[2]) / 20

const highest:number = Math.max(...r);
const lowest:number = Math.min(...r);
let found:boolean = false
let copyOfOriginalFeature = this.lastSelectedFeature?.clone()
this.source.removeFeature(this.lastSelectedFeature)
this.lastSelectedFeature = undefined
this.clearAllFeatures()
let radius: number = (extent[0] - extent[2]) / 20

for (let x: number = 0; x < width; x++) {
for (let y: number = 0; y < height; y++) {
let center: Array<number> = new Array<number>()
center.push(extent[0] - (x * (radius * 2)) - radius)
center.push(extent[3] + (y * (radius * 2)) + radius)
let circle: Circle = new Circle(center, radius, "XY")
let circleFeature: Feature<Circle> = new Feature({
geometry: circle
});
circleFeature.set("anomaly",r[x*y])
this.source.addFeature(circleFeature)

let anomalyValue = r[x*y]
if (anomalyValue == highest || anomalyValue == lowest) {
found = true
let center: Array<number> = new Array<number>()
center.push(extent[0] - (x * (radius * 2)) - radius)
center.push(extent[3] + (y * (radius * 2)) + radius)
let circle: Circle = new Circle(center, radius, "XY")
let circleFeature: Feature<Circle> = new Feature({
geometry: circle
});

let style: Style = this.styleRedOutline.clone()
style.getFill()?.setColor(`rgba(${anomalyValue / 4}, 0, 0, 0.5)`)

if (anomalyValue == highest) {
style.getText()?.setText('HIGH')
}
if (anomalyValue == lowest) {
style.getText()?.setText('LOW')
}
circleFeature.set("style", style)
this.source.addFeature(circleFeature)
}
}
}

if (!found) {
this.lastSelectedFeature = copyOfOriginalFeature
const that = this
setTimeout(function (){
let style: Style = that.styleRedOutline.clone()
style.getText()?.setText('NOT FOUND')
copyOfOriginalFeature.set("style", style)
that.source.addFeature(copyOfOriginalFeature)
that.lastSelectedFeature = copyOfOriginalFeature
},500)

}

try {
this.map?.getView().fit(extent, {duration: 777});
} catch (e) {
Expand Down Expand Up @@ -463,4 +506,14 @@ export class MapComponent implements OnInit, AfterViewInit {
this.bookmarks.splice(index, 1);
}
}

openGoogleEarth() {
// Construct the Google Earth URL with the KML data
// @ts-ignore
const googleEarthUrl = `https://earth.google.com/web/@${this.getCoordinates(this.map?.getView().getCenter()).toString().split(',')[1]},${this.getCoordinates(this.map?.getView().getCenter()).toString().split(',')[0]},z=${Math.trunc(this.map?.getView().getZoom())}`;

// Open Google Earth in a new tab/window
window.open(googleEarthUrl, '_blank');
}

}
2 changes: 1 addition & 1 deletion startGui.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
call java -jar AetherOnePi-1.3.7.jar
call java -jar AetherOnePi-1.3.8.jar
rem pause

0 comments on commit c78aca9

Please sign in to comment.