![]() |
CARTA Backend
The backend component of CARTA
|
#include <Session.h>
Public Member Functions | |
Session (uWS::WebSocket< false, true, PerSocketData > *ws, uWS::Loop *loop, uint32_t id, std::string address, std::shared_ptr< FileListHandler > file_list_handler) | |
~Session () | |
void | OnRegisterViewer (const CARTA::RegisterViewer &message, uint16_t icd_version, uint32_t request_id) |
void | OnFileListRequest (const CARTA::FileListRequest &request, uint32_t request_id) |
void | OnFileInfoRequest (const CARTA::FileInfoRequest &request, uint32_t request_id) |
bool | OnOpenFile (const CARTA::OpenFile &message, uint32_t request_id, bool silent=false) |
bool | OnOpenFile (int file_id, const string &name, std::shared_ptr< casacore::ImageInterface< casacore::Float > > image, CARTA::OpenFileAck *open_file_ack) |
void | OnCloseFile (const CARTA::CloseFile &message) |
void | OnAddRequiredTiles (const CARTA::AddRequiredTiles &message, int channel=CURRENT_Z, int animation_id=0, bool skip_data=false) |
void | OnSetImageChannels (const CARTA::SetImageChannels &message) |
void | OnSetCursor (const CARTA::SetCursor &message, uint32_t request_id) |
bool | OnSetRegion (const CARTA::SetRegion &message, uint32_t request_id, bool silent=false) |
void | OnRemoveRegion (const CARTA::RemoveRegion &message) |
void | OnImportRegion (const CARTA::ImportRegion &message, uint32_t request_id) |
void | OnExportRegion (const CARTA::ExportRegion &message, uint32_t request_id) |
void | OnSetSpatialRequirements (const CARTA::SetSpatialRequirements &message) |
void | OnSetHistogramRequirements (const CARTA::SetHistogramRequirements &message, uint32_t request_id) |
void | OnSetSpectralRequirements (const CARTA::SetSpectralRequirements &message) |
void | OnSetStatsRequirements (const CARTA::SetStatsRequirements &message) |
void | OnSetContourParameters (const CARTA::SetContourParameters &message, bool silent=false) |
void | OnRegionListRequest (const CARTA::RegionListRequest &request, uint32_t request_id) |
void | OnRegionFileInfoRequest (const CARTA::RegionFileInfoRequest &request, uint32_t request_id) |
void | OnResumeSession (const CARTA::ResumeSession &message, uint32_t request_id) |
void | OnCatalogFileList (CARTA::CatalogListRequest file_list_request, uint32_t request_id) |
void | OnCatalogFileInfo (CARTA::CatalogFileInfoRequest file_info_request, uint32_t request_id) |
void | OnOpenCatalogFile (CARTA::OpenCatalogFile open_file_request, uint32_t request_id, bool silent=false) |
void | OnCloseCatalogFile (CARTA::CloseCatalogFile close_file_request) |
void | OnCatalogFilter (CARTA::CatalogFilterRequest filter_request, uint32_t request_id) |
void | OnMomentRequest (const CARTA::MomentRequest &moment_request, uint32_t request_id) |
void | OnStopMomentCalc (const CARTA::StopMomentCalc &stop_moment_calc) |
void | OnSaveFile (const CARTA::SaveFile &save_file, uint32_t request_id) |
bool | OnConcatStokesFiles (const CARTA::ConcatStokesFiles &message, uint32_t request_id) |
void | OnPvRequest (const CARTA::PvRequest &pv_request, uint32_t request_id) |
void | OnStopPvCalc (const CARTA::StopPvCalc &stop_pv_calc) |
void | OnFittingRequest (const CARTA::FittingRequest &fitting_request, uint32_t request_id) |
void | OnStopFitting (const CARTA::StopFitting &stop_fitting) |
void | OnSetVectorOverlayParameters (const CARTA::SetVectorOverlayParameters &message) |
void | OnStopPvPreview (const CARTA::StopPvPreview &stop_pv_preview) |
void | OnClosePvPreview (const CARTA::ClosePvPreview &close_pv_preview) |
void | OnRemoteFileRequest (const CARTA::RemoteFileRequest &message, uint32_t request_id) |
void | AddToSetChannelQueue (CARTA::SetImageChannels message, uint32_t request_id) |
void | ExecuteSetChannelEvt (std::pair< CARTA::SetImageChannels, uint32_t > request) |
void | HandleChannelMapFlowControlEvt (CARTA::ChannelMapFlowControl &message) |
void | CancelSetHistRequirements () |
void | ResetHistContext () |
SessionContext & | HistContext () |
SessionContext & | AnimationContext () |
void | CancelAnimation () |
void | BuildAnimationObject (CARTA::StartAnimation &msg, uint32_t request_id) |
bool | ExecuteAnimationFrame () |
void | ExecuteAnimationFrameInner (int animation_id) |
void | StopAnimation (int file_id, const ::CARTA::AnimationFrame &frame) |
void | HandleAnimationFlowControlEvt (CARTA::AnimationFlowControl &message) |
int | CurrentFlowWindowSize () |
void | CancelExistingAnimation () |
void | CheckCancelAnimationOnFileClose (int file_id) |
void | AddCursorSetting (CARTA::SetCursor message, uint32_t request_id) |
void | ImageChannelLock (int file_id) |
void | ImageChannelUnlock (int file_id) |
bool | ImageChannelTaskTestAndSet (int file_id) |
void | ImageChannelTaskSetIdle (int file_id) |
int | IncreaseRefCount () |
int | DecreaseRefCount () |
int | GetRefCount () |
void | WaitForTaskCancellation () |
void | ConnectCalled () |
SessionContext & | Context () |
void | SetWaitingTask (bool set_wait) |
bool | WaitingFlowEvent () |
bool | AnimationRunning () |
int | CalculateAnimationFlowWindow () |
uint32_t | GetId () |
std::string | GetAddress () |
void | RegionDataStreams (int file_id, int region_id) |
bool | SendSpectralProfileData (int file_id, int region_id, bool stokes_changed=false) |
bool | SendPvPreview (int file_id, int region_id, bool preview_region) |
void | StopPvPreviewUpdates (int preview_id) |
void | SendScriptingRequest (CARTA::ScriptingRequest &message, ScriptingResponseCallback callback, ScriptingSessionClosedCallback session_closed_callback) |
void | OnScriptingResponse (const CARTA::ScriptingResponse &message, uint32_t request_id) |
void | OnScriptingAbort (uint32_t scripting_request_id) |
void | CloseAllScriptingRequests () |
void | StopImageFileList () |
void | StopCatalogFileList () |
void | UpdateLastMessageTimestamp () |
std::chrono::high_resolution_clock::time_point | GetLastMessageTimestamp () |
void | CloseCachedImage (const std::string &directory, const std::string &file) |
bool | AnimationActive () |
void | SetAnimationActive (bool val) |
Static Public Member Functions | |
static int | NumberOfSessions () |
static void | SetExitTimeout (int secs) |
static void | SetInitExitTimeout (int secs) |
static void | SetControllerDeploymentFlag (bool controller_deployment) |
Public Attributes | |
CursorSettings | _cursor_settings |
std::unordered_map< int, concurrent_queue< std::pair< CARTA::SetImageChannels, uint32_t > > > | _set_channel_queues |
Protected Member Functions | |
bool | FillExtendedFileInfo (std::map< std::string, CARTA::FileInfoExtended > &hdu_info_map, CARTA::FileInfo &file_info, const std::string &folder, const std::string &filename, const std::string &hdu, bool support_aips_beam, std::string &message) |
bool | FillExtendedFileInfo (CARTA::FileInfoExtended &extended_info, CARTA::FileInfo &file_info, const std::string &folder, const std::string &filename, std::string &hdu_name, bool support_aips_beam, std::string &message, std::string &fullname) |
bool | FillFileInfo (CARTA::FileInfo &file_info, const std::string &folder, const std::string &filename, std::string &fullname, std::string &message) |
bool | FillExtendedFileInfo (CARTA::FileInfoExtended &extended_info, std::shared_ptr< casacore::ImageInterface< float > > image, const std::string &filename, std::string &message, std::shared_ptr< FileLoader > &image_loader) |
int | GetNextFileId () |
void | DeleteFrame (int file_id) |
bool | CalculateCubeHistogram (int file_id, CARTA::RegionHistogramData &cube_histogram_message) |
bool | SendContourData (int file_id, bool ignore_empty=true, int channel=CURRENT_Z) |
bool | SendSpatialProfileData (int file_id, int region_id) |
void | SendSpatialProfileDataByFileId (int file_id) |
void | SendSpatialProfileDataByRegionId (int region_id) |
bool | SendRegionHistogramData (int file_id, int region_id, bool channel_changed=false) |
bool | SendRegionStatsData (int file_id, int region_id) |
void | UpdateImageData (int file_id, bool send_image_histogram, bool z_changed, bool stokes_changed) |
void | UpdateRegionData (int file_id, int region_id, bool z_changed, bool stokes_changed) |
bool | SendVectorFieldData (int file_id) |
void | SendEvent (CARTA::EventType event_type, u_int32_t event_id, const google::protobuf::MessageLite &message, bool compress=true) |
void | SendFileEvent (int file_id, CARTA::EventType event_type, u_int32_t event_id, google::protobuf::MessageLite &message, bool compress=true) |
void | SendLogEvent (const std::string &message, std::vector< std::string > tags, CARTA::ErrorSeverity severity) |
bool | IsInChannelMapRange (int file_id, int channel) |
bool | HasValidChannelMapTiles (int file_id, const CARTA::AddRequiredTiles &required_tiles) |
bool | GetValidChannelMapTiles (int file_id, const CARTA::AddRequiredTiles &required_tiles, std::vector< int > &valid_tiles) |
Static Protected Attributes | |
static volatile int | _num_sessions = 0 |
static int | _exit_after_num_seconds = 5 |
static bool | _exit_when_all_sessions_closed = false |
static bool | _controller_deployment = false |
static std::thread * | _animation_thread = nullptr |
Session::Session | ( | uWS::WebSocket< false, true, PerSocketData > * | ws, |
uWS::Loop * | loop, | ||
uint32_t | id, | ||
std::string | address, | ||
std::shared_ptr< FileListHandler > | file_list_handler | ||
) |
Session::~Session | ( | ) |
|
inline |
void Session::AddToSetChannelQueue | ( | CARTA::SetImageChannels | message, |
uint32_t | request_id | ||
) |
|
inline |
|
inline |
|
inline |
void Session::BuildAnimationObject | ( | CARTA::StartAnimation & | msg, |
uint32_t | request_id | ||
) |
int Session::CalculateAnimationFlowWindow | ( | ) |
|
protected |
|
inline |
void Session::CancelExistingAnimation | ( | ) |
|
inline |
void Session::CheckCancelAnimationOnFileClose | ( | int | file_id | ) |
void Session::CloseAllScriptingRequests | ( | ) |
void Session::CloseCachedImage | ( | const std::string & | directory, |
const std::string & | file | ||
) |
void Session::ConnectCalled | ( | ) |
|
inline |
|
inline |
|
inline |
|
protected |
bool Session::ExecuteAnimationFrame | ( | ) |
void Session::ExecuteAnimationFrameInner | ( | int | animation_id | ) |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
inline |
|
inline |
std::chrono::high_resolution_clock::time_point Session::GetLastMessageTimestamp | ( | ) |
|
inlineprotected |
|
inline |
|
protected |
void Session::HandleAnimationFlowControlEvt | ( | CARTA::AnimationFlowControl & | message | ) |
void Session::HandleChannelMapFlowControlEvt | ( | CARTA::ChannelMapFlowControl & | message | ) |
|
protected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
inlinestatic |
void Session::OnAddRequiredTiles | ( | const CARTA::AddRequiredTiles & | message, |
int | channel = CURRENT_Z , |
||
int | animation_id = 0 , |
||
bool | skip_data = false |
||
) |
void Session::OnCatalogFileInfo | ( | CARTA::CatalogFileInfoRequest | file_info_request, |
uint32_t | request_id | ||
) |
void Session::OnCatalogFileList | ( | CARTA::CatalogListRequest | file_list_request, |
uint32_t | request_id | ||
) |
void Session::OnCatalogFilter | ( | CARTA::CatalogFilterRequest | filter_request, |
uint32_t | request_id | ||
) |
void Session::OnCloseCatalogFile | ( | CARTA::CloseCatalogFile | close_file_request | ) |
void Session::OnCloseFile | ( | const CARTA::CloseFile & | message | ) |
void Session::OnClosePvPreview | ( | const CARTA::ClosePvPreview & | close_pv_preview | ) |
bool Session::OnConcatStokesFiles | ( | const CARTA::ConcatStokesFiles & | message, |
uint32_t | request_id | ||
) |
void Session::OnExportRegion | ( | const CARTA::ExportRegion & | message, |
uint32_t | request_id | ||
) |
void Session::OnFileInfoRequest | ( | const CARTA::FileInfoRequest & | request, |
uint32_t | request_id | ||
) |
void Session::OnFileListRequest | ( | const CARTA::FileListRequest & | request, |
uint32_t | request_id | ||
) |
void Session::OnFittingRequest | ( | const CARTA::FittingRequest & | fitting_request, |
uint32_t | request_id | ||
) |
void Session::OnImportRegion | ( | const CARTA::ImportRegion & | message, |
uint32_t | request_id | ||
) |
void Session::OnMomentRequest | ( | const CARTA::MomentRequest & | moment_request, |
uint32_t | request_id | ||
) |
void Session::OnOpenCatalogFile | ( | CARTA::OpenCatalogFile | open_file_request, |
uint32_t | request_id, | ||
bool | silent = false |
||
) |
bool Session::OnOpenFile | ( | const CARTA::OpenFile & | message, |
uint32_t | request_id, | ||
bool | silent = false |
||
) |
bool Session::OnOpenFile | ( | int | file_id, |
const string & | name, | ||
std::shared_ptr< casacore::ImageInterface< casacore::Float > > | image, | ||
CARTA::OpenFileAck * | open_file_ack | ||
) |
void Session::OnPvRequest | ( | const CARTA::PvRequest & | pv_request, |
uint32_t | request_id | ||
) |
void Session::OnRegionFileInfoRequest | ( | const CARTA::RegionFileInfoRequest & | request, |
uint32_t | request_id | ||
) |
void Session::OnRegionListRequest | ( | const CARTA::RegionListRequest & | request, |
uint32_t | request_id | ||
) |
void Session::OnRegisterViewer | ( | const CARTA::RegisterViewer & | message, |
uint16_t | icd_version, | ||
uint32_t | request_id | ||
) |
void Session::OnRemoteFileRequest | ( | const CARTA::RemoteFileRequest & | message, |
uint32_t | request_id | ||
) |
void Session::OnRemoveRegion | ( | const CARTA::RemoveRegion & | message | ) |
void Session::OnResumeSession | ( | const CARTA::ResumeSession & | message, |
uint32_t | request_id | ||
) |
void Session::OnSaveFile | ( | const CARTA::SaveFile & | save_file, |
uint32_t | request_id | ||
) |
void Session::OnScriptingAbort | ( | uint32_t | scripting_request_id | ) |
void Session::OnScriptingResponse | ( | const CARTA::ScriptingResponse & | message, |
uint32_t | request_id | ||
) |
void Session::OnSetContourParameters | ( | const CARTA::SetContourParameters & | message, |
bool | silent = false |
||
) |
void Session::OnSetCursor | ( | const CARTA::SetCursor & | message, |
uint32_t | request_id | ||
) |
void Session::OnSetHistogramRequirements | ( | const CARTA::SetHistogramRequirements & | message, |
uint32_t | request_id | ||
) |
void Session::OnSetImageChannels | ( | const CARTA::SetImageChannels & | message | ) |
bool Session::OnSetRegion | ( | const CARTA::SetRegion & | message, |
uint32_t | request_id, | ||
bool | silent = false |
||
) |
void Session::OnSetSpatialRequirements | ( | const CARTA::SetSpatialRequirements & | message | ) |
void Session::OnSetSpectralRequirements | ( | const CARTA::SetSpectralRequirements & | message | ) |
void Session::OnSetStatsRequirements | ( | const CARTA::SetStatsRequirements & | message | ) |
void Session::OnSetVectorOverlayParameters | ( | const CARTA::SetVectorOverlayParameters & | message | ) |
void Session::OnStopFitting | ( | const CARTA::StopFitting & | stop_fitting | ) |
void Session::OnStopMomentCalc | ( | const CARTA::StopMomentCalc & | stop_moment_calc | ) |
void Session::OnStopPvCalc | ( | const CARTA::StopPvCalc & | stop_pv_calc | ) |
void Session::OnStopPvPreview | ( | const CARTA::StopPvPreview & | stop_pv_preview | ) |
void Session::RegionDataStreams | ( | int | file_id, |
int | region_id | ||
) |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
bool Session::SendPvPreview | ( | int | file_id, |
int | region_id, | ||
bool | preview_region | ||
) |
|
protected |
|
protected |
void Session::SendScriptingRequest | ( | CARTA::ScriptingRequest & | message, |
ScriptingResponseCallback | callback, | ||
ScriptingSessionClosedCallback | session_closed_callback | ||
) |
|
protected |
|
protected |
|
protected |
bool Session::SendSpectralProfileData | ( | int | file_id, |
int | region_id, | ||
bool | stokes_changed = false |
||
) |
|
protected |
|
inline |
|
inlinestatic |
|
static |
|
static |
|
inline |
void Session::StopAnimation | ( | int | file_id, |
const ::CARTA::AnimationFrame & | frame | ||
) |
void Session::StopCatalogFileList | ( | ) |
void Session::StopImageFileList | ( | ) |
void Session::StopPvPreviewUpdates | ( | int | preview_id | ) |
|
protected |
void Session::UpdateLastMessageTimestamp | ( | ) |
|
protected |
void Session::WaitForTaskCancellation | ( | ) |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
CursorSettings carta::Session::_cursor_settings |
|
protected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
std::unordered_map<int, concurrent_queue<std::pair<CARTA::SetImageChannels, uint32_t> > > carta::Session::_set_channel_queues |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |