Commit 3b63f695 authored by WuFeiyang's avatar WuFeiyang

20200116

parent edbde80b
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<div <div
style="width:100%;overflow:auto;border-style: solid; border-width: 1px;" style="width:100%;overflow:auto;border-style: solid; border-width: 1px;"
> >
<p style="float:left;margin:0px" class="valueFont">{{ StatusValue }}</p> <p style="float:left;margin:0px" class="largeFont">{{ StatusValue }}</p>
</div> </div>
</b-col> </b-col>
</b-row> </b-row>
......
...@@ -80,6 +80,7 @@ export default class setBasicParams extends Vue { ...@@ -80,6 +80,7 @@ export default class setBasicParams extends Vue {
xmin:any; xmin:any;
xmax:any; xmax:any;
nowDotNum:any; nowDotNum:any;
GetAllDot:boolean = false;
created() { created() {
this.config.data.userInputData = this.userInputData; this.config.data.userInputData = this.userInputData;
...@@ -520,10 +521,10 @@ export default class setBasicParams extends Vue { ...@@ -520,10 +521,10 @@ export default class setBasicParams extends Vue {
if ( if (
nowZoom_xmin < zoom_xmin || nowZoom_xmin < zoom_xmin ||
nowZoom_xmax > zoom_xmax || nowZoom_xmax > zoom_xmax ||
((x_range/nowRange)*this.nowDotNum < expectedDotNum) (((x_range/nowRange)*this.nowDotNum < expectedDotNum)&&(this.GetAllDot==false))
) { ) {
this.GetAllDot = false;
expansionStartTime = Number(nowZoom_xmin)-expansionMultiple*x_range >= this.xmin?Number(nowZoom_xmin)-expansionMultiple*x_range:this.xmin; expansionStartTime = Number(nowZoom_xmin)-expansionMultiple*x_range >= this.xmin?Number(nowZoom_xmin)-expansionMultiple*x_range:this.xmin;
expansionEndTime = Number(nowZoom_xmax)+expansionMultiple*x_range <= this.xmax? Number(nowZoom_xmax)+expansionMultiple*x_range:this.xmax; expansionEndTime = Number(nowZoom_xmax)+expansionMultiple*x_range <= this.xmax? Number(nowZoom_xmax)+expansionMultiple*x_range:this.xmax;
console.log(expansionStartTime); console.log(expansionStartTime);
...@@ -550,49 +551,6 @@ export default class setBasicParams extends Vue { ...@@ -550,49 +551,6 @@ export default class setBasicParams extends Vue {
getInputData.set("endTime",expansionEndTime); getInputData.set("endTime",expansionEndTime);
getInputData.set("count",expansionDotNum); getInputData.set("count",expansionDotNum);
var url = pathProcessor.FillPathWithVar(
getInputData,
config.data.url.path
);
getData(url);
//当点不够时取全部点并重新获取y轴
if(temp.data == null)
{
getInputData.set("count","0");
url = pathProcessor.FillPathWithVar(
getInputData,
config.data.url.path
);
getData(url);
}
var timeUrl = pathProcessor.FillPathWithVar(
getInputData,
config.data.url.timePath
);
console.log(url);
console.log(timeUrl);
getDataTimeAxis(timeUrl);
getConfig.data.position.x1 = zoom_xmin;
getConfig.data.position.x2 = zoom_xmax;
getConfig.data.position.y1 = zoom_ymin;
getConfig.data.position.y2 = zoom_ymax;
updateConfig();
var data_update = [
{
x: temp.dataTimeAxis,
y: temp.data
}
];
console.log("data_update");
console.log(data_update);
var myplot = this.wave; var myplot = this.wave;
var yRange = myplot.layout.yaxis.range; var yRange = myplot.layout.yaxis.range;
...@@ -621,24 +579,25 @@ export default class setBasicParams extends Vue { ...@@ -621,24 +579,25 @@ export default class setBasicParams extends Vue {
}; };
} }
createChannelChart(this.myPlot, data_update, layout_update); getConfig.data.position.x1 = zoom_xmin;
this.zoom(); getConfig.data.position.x2 = zoom_xmax;
getConfig.data.position.y1 = zoom_ymin;
getConfig.data.position.y2 = zoom_ymax;
updateConfig();
this.showPlot(getInputData,layout_update,this.myPlot);
} }
} }
}); });
this.myPlot.on("plotly_doubleclick", ()=> { // this.myPlot.on("plotly_doubleclick", ()=> {
nowRange = temp.dataTimeAxis[this.nowDotNum - 1]; // console.log("plotly_doubleclick");
createChannelChart(this.myPlot, this.data_initial); // createChannelChart(this.myPlot, this.data_initial);
this.zoom(); // this.zoom();
}); // });
this.myPlot.on("plotly_click", (data:any)=>{ this.myPlot.on("plotly_click", (data:any)=>{
//当前区域的范围 //当前区域的范围
console.log("plotly_click") console.log("plotly_click");
console.log(data.points[0].xaxis.range); console.log(data.points[0].xaxis.range);
console.log(data.points[0].yaxis.range); console.log(data.points[0].yaxis.range);
console.log(data); console.log(data);
...@@ -662,6 +621,50 @@ export default class setBasicParams extends Vue { ...@@ -662,6 +621,50 @@ export default class setBasicParams extends Vue {
}); });
} }
async showPlot(getInputData:any,layout_update:any,myPlot:any)
{
var url = this.pathProcessor.FillPathWithVar(
getInputData,
this.config.data.url.path
);
await this.getData(url);
console.log("重加载getData");
console.log(this.temp.data);
//当点不够时取全部点并重新获取y轴
if(this.temp.data == null)
{
getInputData.set("count","0");
this.GetAllDot = true;
url = this.pathProcessor.FillPathWithVar(
getInputData,
this.config.data.url.path
);
await this.getData(url);
}
var timeUrl = this.pathProcessor.FillPathWithVar(
getInputData,
this.config.data.url.timePath
);
console.log(url);
console.log(timeUrl);
await this.getDataTimeAxis(timeUrl);
console.log("重加载getDataTimeAxis");
console.log(this.temp.dataTimeAxis);
var data_update = [
{
x: this.temp.dataTimeAxis,
y: this.temp.data
}
];
console.log("data_update");
console.log(data_update);
this.createChannelChart(myPlot, data_update, layout_update);
this.zoom();
}
addAnnotations(annotations:any) addAnnotations(annotations:any)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment