Skip to content

Commit

Permalink
add more comments about old event fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mudhoney committed Jun 17, 2024
1 parent 6e05c2c commit e37c96d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/Database/ImgIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public function insertScreenshot($date, $imageScale, $roi, $watermark, $layers,

$this->_dbConnect();

// ATTENTION! These two fields eventsLabels and eventSourceString needs to be kept in DB schema
// We are keeping them to support old takeScreenshot , queueMovie requests

// old implementation removed for events strings
// used to be $this->events->serialize();
$old_events_layer_string = "";
Expand Down
4 changes: 3 additions & 1 deletion src/Database/MovieDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ public function insertMovie($startTime, $endTime, $reqObservationDate, $imageSca
$reqObservationDate = "NULL";
}

// !Attention we are keeping those fields for current rows in movies and screenshots tables
// ATTENTION! These two fields eventsLabels and eventSourceString needs to be kept in DB schema
// We are keeping them to support old takeScreenshot , queueMovie requests

// old implementation removed for events strings
// used to be $this->events->serialize();
$old_events_layer_string = "";
Expand Down
8 changes: 5 additions & 3 deletions src/Module/Movies.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Helioviewer Movies Module class definition
* Movie generation and display.
Expand Down Expand Up @@ -308,8 +307,11 @@ public function queueMovie() {
$event_labels = (bool)$this->_params['eventLabels'];
}

// Events manager built from old logic
$events_manager = EventsStateManager::buildFromLegacyEventStrings($events_legacy_string, $event_labels);
// ATTENTION! These two fields eventsLabels and eventSourceString needs to be kept in DB schema
// We are keeping them to support old takeScreenshot , queueMovie requests

// Events manager built from old logic
$events_manager = EventsStateManager::buildFromLegacyEventStrings($events_legacy_string, $event_labels);

// TODO 2012/04/11
// Discard any layers which do not share an overlap with the roi to
Expand Down
11 changes: 10 additions & 1 deletion src/Module/WebClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,10 @@ public function takeScreenshot() {
$event_labels = (bool)$this->_params['eventLabels'];
}


// ATTENTION! These two fields eventsLabels and eventSourceString needs to be kept in DB schema
// We are keeping them to support old takeScreenshot , queueMovie requests

// Events manager built from old logic
$events_manager = EventsStateManager::buildFromLegacyEventStrings($events_legacy_string, $event_labels);

Expand Down Expand Up @@ -693,6 +697,9 @@ public function reTakeScreenshot($screenshotId) {
$events_state_from_metadata = json_decode($metaData['eventsState'], true);
$events_manager;

// ATTENTION! These two fields eventsLabels and eventSourceString needs to be kept in DB schema
// We are keeping them to support old takeScreenshot , queueMovie requests

if(!empty($events_state_from_metadata)) {
$events_manager = EventsStateManager::buildFromEventsState($events_state_from_metadata);
} else {
Expand Down Expand Up @@ -788,7 +795,6 @@ public function saveWebClientState() {
$client_state = new ClientState();

try {

$state_key = $client_state->upsert($this->_params['json']);

return $this->_sendResponse(200, 'OK', $state_key);
Expand Down Expand Up @@ -1358,6 +1364,9 @@ public function getEclipseImage() {
$range = 6000;
$roi = new Helper_RegionOfInterest(-$range, -$range, $range, $range, 15);

// ATTENTION! These two fields eventsLabels and eventSourceString needs to be kept in DB schema
// We are keeping them to support old takeScreenshot , queueMovie requests

// Create empty events object required for screenshots.
$events_manager = EventStateManager::buildFromLegacyEventStrings('', false);

Expand Down
3 changes: 3 additions & 0 deletions src/Movie/HelioviewerMovie.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ public function __construct($publicId, $format='mp4') {
// Data Layers
$this->_layers = new Helper_HelioviewerLayers($info['dataSourceString']);

// ATTENTION! These two fields eventsLabels and eventSourceString needs to be kept in DB schema
// We are keeping them to support old takeScreenshot , queueMovie requests

// Events Manager
$events_state_from_info = json_decode($info['eventsState'], true);

Expand Down

0 comments on commit e37c96d

Please sign in to comment.