Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update pilot gui and install/setup instructions #46
- Loading branch information
Showing
5 changed files
with
65 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,31 @@ | ||
library(shiny) | ||
library(shinyFiles) | ||
library(visioneval) | ||
|
||
# Define server logic required to draw a histogram | ||
# Define server logic | ||
shinyServer(function(input, output) { | ||
|
||
#file picker | ||
shinyFileChoose(input, 'file', root=getVolumes(''), filetypes=c('', 'R')) | ||
|
||
#run model on file name change | ||
observeEvent(input$file, { | ||
|
||
#parse script name | ||
inFile = parseFilePaths(roots=getVolumes(''), input$file) | ||
scriptName = as.character(inFile$datapath) | ||
output$filepath = renderPrint( { scriptName } ) | ||
|
||
#run model | ||
setwd(dirname(scriptName)) | ||
output$scriptprint = renderPrint( { | ||
capture.output(source(scriptName, local=FALSE)) #sourced in global environment | ||
} ) | ||
|
||
#read resulting datastore | ||
datastorePrint = capture.output(getModelState("Datastore")) | ||
output$datastorelist = renderPrint( { datastorePrint } ) | ||
|
||
# Expression that generates a histogram. The expression is | ||
# wrapped in a call to renderPlot to indicate that: | ||
# | ||
# 1) It is "reactive" and therefore should re-execute automatically | ||
# when inputs change | ||
# 2) Its output type is a plot | ||
}) | ||
|
||
output$distPlot <- renderPlot({ | ||
x <- faithful[, 2] # Old Faithful Geyser data | ||
bins <- seq(min(x), max(x), length.out = input$bins + 1) | ||
|
||
# draw the histogram with the specified number of bins | ||
hist(x, breaks = bins, col = 'darkgray', border = 'white') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,33 @@ | ||
library(shiny) | ||
library(shinyFiles) | ||
|
||
# Define UI for application that draws a histogram | ||
# Define UI for application | ||
shinyUI(fluidPage( | ||
|
||
# Application title | ||
titlePanel("VisionEval"), | ||
titlePanel("Pilot Model Runner and Scenario Viewer"), | ||
|
||
# Sidebar with a slider input for the number of bins | ||
sidebarLayout( | ||
sidebarPanel( | ||
sliderInput("bins", | ||
"Number of bins:", | ||
min = 1, | ||
max = 50, | ||
value = 30) | ||
), | ||
|
||
# Show a plot of the generated distribution | ||
mainPanel( | ||
plotOutput("distPlot") | ||
sidebarLayout( | ||
|
||
sidebarPanel( | ||
|
||
img(src="visioneval_logo.png", height=100, width=100, style="margin:10px 10px"), | ||
|
||
shinyFilesButton('file', label='Select Model Run Script', | ||
title='Please select model run script', multiple=FALSE) | ||
|
||
), | ||
|
||
mainPanel( | ||
|
||
h3("Script Name"), | ||
verbatimTextOutput('filepath', TRUE), | ||
h3("Script Output"), | ||
verbatimTextOutput('scriptprint', TRUE), | ||
h3("Datastore List"), | ||
verbatimTextOutput('datastorelist', TRUE) | ||
|
||
) | ||
|
||
) | ||
) | ||
|
||
)) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.