forked from tmilliman/drawROI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.R
executable file
·65 lines (51 loc) · 1.6 KB
/
global.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#######################################################################
# The global setup for the drawROI shiny app.
#
# The drawROI app is developed and maintained by Bijan Seyednasrollah.
# The main initial development was done in May to November, 2017.
#
# Most recent release: https://github.com/bnasr/drawROI
#######################################################################
# library(shiny, lib="/home/mkf58/Documents/Development/Phoenocam/shiny_1_4_0_2")
source('funcs.R')
list.of.packages <- c(
'shiny',
'shinyjs',
'shinyBS',
'shinythemes',
'colourpicker',
'rjson',
'stringr',
'sendmailR',
'sp',
'raster',
'jpeg',
'tiff',
'data.table',
'lubridate',
'plotly',
'RCurl'
)
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])]
if(length(new.packages)) install.packages(new.packages, repos='http://cran.rstudio.com/')
for(p in list.of.packages) library(p, character.only = T)
CACHE_LIMIT <- 5000
PRINT_LOGS <- TRUE
if(system('hostname', intern=T)%in%c('phenocam')) PRINT_LOGS <- T
HTTP_LOAD <- TRUE
SHINY_SERVER <- FALSE
SHINY_SERVER_FQDN = Sys.getenv("HOSTNAME")
# For Testing on local system
SHINY_SERVER_FQDN = 'phenocam.nau.edu'
maskStartDate = '2001-01-01'
maskEndDate = '9999-12-31'
sitesInfoURL <- paste0('https://', SHINY_SERVER_FQDN, '/webcam/network/siteinfo/')
print(paste0('sitesInfoURL: ', sitesInfoURL))
middayListPath <- 'https://phenocam.nau.edu/api/middayimages/'
if(HTTP_LOAD){
mainDataPath <- 'https://phenocam.nau.edu'
}else{
middayListPath <- '/data/archive/'
mainDataPath <- ''
}
print('Global Page Bottom')