kopia lustrzana https://github.com/OpenDroneMap/WebODM
Allow download of camera models, display options during task review
rodzic
7e1705017d
commit
10e00405e1
|
@ -156,6 +156,7 @@ class Task(models.Model):
|
||||||
'deferred_path': 'orthophoto_tiles.zip',
|
'deferred_path': 'orthophoto_tiles.zip',
|
||||||
'deferred_compress_dir': 'orthophoto_tiles'
|
'deferred_compress_dir': 'orthophoto_tiles'
|
||||||
},
|
},
|
||||||
|
'cameras.json': 'cameras.json',
|
||||||
}
|
}
|
||||||
|
|
||||||
STATUS_CODES = (
|
STATUS_CODES = (
|
||||||
|
|
|
@ -44,6 +44,7 @@ const api = {
|
||||||
new AssetDownload("Point Cloud (PLY)","georeferenced_model.ply","fa fa-cube"),
|
new AssetDownload("Point Cloud (PLY)","georeferenced_model.ply","fa fa-cube"),
|
||||||
new AssetDownload("Point Cloud (CSV)","georeferenced_model.csv","fa fa-cube"),
|
new AssetDownload("Point Cloud (CSV)","georeferenced_model.csv","fa fa-cube"),
|
||||||
new AssetDownload("Textured Model","textured_model.zip","fa fa-connectdevelop"),
|
new AssetDownload("Textured Model","textured_model.zip","fa fa-connectdevelop"),
|
||||||
|
new AssetDownload("Camera Parameters","cameras.json","fa fa-camera"),
|
||||||
new AssetDownloadSeparator(),
|
new AssetDownloadSeparator(),
|
||||||
new AssetDownload("All Assets","all.zip","fa fa-file-archive-o")
|
new AssetDownload("All Assets","all.zip","fa fa-file-archive-o")
|
||||||
];
|
];
|
||||||
|
|
|
@ -13,6 +13,7 @@ class EditTaskForm extends React.Component {
|
||||||
selectedNode: null,
|
selectedNode: null,
|
||||||
task: null,
|
task: null,
|
||||||
onFormChanged: () => {},
|
onFormChanged: () => {},
|
||||||
|
inReview: false
|
||||||
};
|
};
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
|
@ -22,6 +23,7 @@ class EditTaskForm extends React.Component {
|
||||||
]),
|
]),
|
||||||
onFormLoaded: PropTypes.func,
|
onFormLoaded: PropTypes.func,
|
||||||
onFormChanged: PropTypes.func,
|
onFormChanged: PropTypes.func,
|
||||||
|
inReview: PropTypes.bool,
|
||||||
task: PropTypes.object
|
task: PropTypes.object
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -323,7 +325,9 @@ class EditTaskForm extends React.Component {
|
||||||
|
|
||||||
getAvailableOptionsOnlyText(options, availableOptions){
|
getAvailableOptionsOnlyText(options, availableOptions){
|
||||||
const opts = this.getAvailableOptionsOnly(options, availableOptions);
|
const opts = this.getAvailableOptionsOnly(options, availableOptions);
|
||||||
return opts.map(opt => `${opt.name}:${opt.value}`).join(", ");
|
let res = opts.map(opt => `${opt.name}:${opt.value}`).join(", ");
|
||||||
|
if (!res) res = "Default";
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
saveLastPresetToStorage(){
|
saveLastPresetToStorage(){
|
||||||
|
@ -479,6 +483,49 @@ class EditTaskForm extends React.Component {
|
||||||
let taskOptions = "";
|
let taskOptions = "";
|
||||||
if (this.formReady()){
|
if (this.formReady()){
|
||||||
|
|
||||||
|
const optionsSelector = (<div>
|
||||||
|
<select
|
||||||
|
title={this.getAvailableOptionsOnlyText(this.state.selectedPreset.options, this.state.selectedNode.options)}
|
||||||
|
className="form-control"
|
||||||
|
value={this.state.selectedPreset.id}
|
||||||
|
onChange={this.handleSelectPreset}>
|
||||||
|
{this.state.presets.map(preset =>
|
||||||
|
<option value={preset.id} key={preset.id} className={preset.system ? "system-preset" : ""}>{preset.name}</option>
|
||||||
|
)}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
{!this.state.presetActionPerforming ?
|
||||||
|
<div className="btn-group presets-dropdown">
|
||||||
|
<button type="button" className="btn btn-default" onClick={this.handleEditPreset}>
|
||||||
|
<i className="fa fa-sliders"></i>
|
||||||
|
</button>
|
||||||
|
<button type="button" className="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
<span className="caret"></span>
|
||||||
|
</button>
|
||||||
|
<ul className="dropdown-menu">
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" onClick={this.handleEditPreset}><i className="fa fa-sliders"></i> Edit</a>
|
||||||
|
</li>
|
||||||
|
<li className="divider"></li>
|
||||||
|
|
||||||
|
{this.state.selectedPreset.id !== -1 ?
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" onClick={this.handleDuplicateSavePreset}><i className="fa fa-copy"></i> Duplicate</a>
|
||||||
|
</li>
|
||||||
|
:
|
||||||
|
<li>
|
||||||
|
<a href="javascript:void(0);" onClick={this.handleDuplicateSavePreset}><i className="fa fa-save"></i> Save</a>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
<li className={this.state.selectedPreset.system ? "disabled" : ""}>
|
||||||
|
<a href="javascript:void(0);" onClick={this.handleDeletePreset}><i className="fa fa-trash-o"></i> Delete</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
: <i className="preset-performing-action-icon fa fa-cog fa-spin fa-fw"></i>}
|
||||||
|
<ErrorMessage className="preset-error" bind={[this, 'presetError']} />
|
||||||
|
</div>);
|
||||||
|
|
||||||
taskOptions = (
|
taskOptions = (
|
||||||
<div>
|
<div>
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
|
@ -494,46 +541,10 @@ class EditTaskForm extends React.Component {
|
||||||
<div className="form-group form-inline">
|
<div className="form-group form-inline">
|
||||||
<label className="col-sm-2 control-label">Options</label>
|
<label className="col-sm-2 control-label">Options</label>
|
||||||
<div className="col-sm-10">
|
<div className="col-sm-10">
|
||||||
<select
|
{!this.props.inReview ? optionsSelector :
|
||||||
title={this.getAvailableOptionsOnlyText(this.state.selectedPreset.options, this.state.selectedNode.options)}
|
<div className="review-options">
|
||||||
className="form-control"
|
{this.getAvailableOptionsOnlyText(this.state.selectedPreset.options, this.state.selectedNode.options)}
|
||||||
value={this.state.selectedPreset.id}
|
</div>}
|
||||||
onChange={this.handleSelectPreset}>
|
|
||||||
{this.state.presets.map(preset =>
|
|
||||||
<option value={preset.id} key={preset.id} className={preset.system ? "system-preset" : ""}>{preset.name}</option>
|
|
||||||
)}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
{!this.state.presetActionPerforming ?
|
|
||||||
<div className="btn-group presets-dropdown">
|
|
||||||
<button type="button" className="btn btn-default" onClick={this.handleEditPreset}>
|
|
||||||
<i className="fa fa-sliders"></i>
|
|
||||||
</button>
|
|
||||||
<button type="button" className="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
|
||||||
<span className="caret"></span>
|
|
||||||
</button>
|
|
||||||
<ul className="dropdown-menu">
|
|
||||||
<li>
|
|
||||||
<a href="javascript:void(0);" onClick={this.handleEditPreset}><i className="fa fa-sliders"></i> Edit</a>
|
|
||||||
</li>
|
|
||||||
<li className="divider"></li>
|
|
||||||
|
|
||||||
{this.state.selectedPreset.id !== -1 ?
|
|
||||||
<li>
|
|
||||||
<a href="javascript:void(0);" onClick={this.handleDuplicateSavePreset}><i className="fa fa-copy"></i> Duplicate</a>
|
|
||||||
</li>
|
|
||||||
:
|
|
||||||
<li>
|
|
||||||
<a href="javascript:void(0);" onClick={this.handleDuplicateSavePreset}><i className="fa fa-save"></i> Save</a>
|
|
||||||
</li>
|
|
||||||
}
|
|
||||||
<li className={this.state.selectedPreset.system ? "disabled" : ""}>
|
|
||||||
<a href="javascript:void(0);" onClick={this.handleDeletePreset}><i className="fa fa-trash-o"></i> Delete</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
: <i className="preset-performing-action-icon fa fa-cog fa-spin fa-fw"></i>}
|
|
||||||
<ErrorMessage className="preset-error" bind={[this, 'presetError']} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,7 @@ class NewTaskPanel extends React.Component {
|
||||||
<EditTaskForm
|
<EditTaskForm
|
||||||
onFormLoaded={this.handleFormTaskLoaded}
|
onFormLoaded={this.handleFormTaskLoaded}
|
||||||
onFormChanged={this.handleFormChanged}
|
onFormChanged={this.handleFormChanged}
|
||||||
|
inReview={this.state.inReview}
|
||||||
ref={(domNode) => { if (domNode) this.taskForm = domNode; }}
|
ref={(domNode) => { if (domNode) this.taskForm = domNode; }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
@ -13,5 +13,10 @@
|
||||||
|
|
||||||
.system-preset{
|
.system-preset{
|
||||||
background-color: #eee;
|
background-color: #eee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.review-options{
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-bottom: 14px;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Launch a development worker so that changes in a dev
|
||||||
|
# environment can be refreshed
|
||||||
|
|
||||||
|
docker stop worker
|
||||||
|
docker-compose -f docker-compose.yml -f docker-compose.dev.yml run --entrypoint bash worker
|
Ładowanie…
Reference in New Issue