Обновление документации
This commit is contained in:
@ -2,30 +2,37 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-module deploy-name="CCALM-1.0.0-BUILD-SNAPSHOT">
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
|
||||
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
|
||||
|
||||
|
||||
|
||||
<property name="java-output-path" value="target/classes"/>
|
||||
|
||||
<property name="context-root" value="CCALM"/>
|
||||
<property name="java-output-path" value="target/classes"/>
|
||||
<property name="context-root" value="CCALM_TOMCAT"/>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -33,4 +40,5 @@
|
||||
|
||||
|
||||
|
||||
|
||||
</project-modules>
|
||||
|
||||
@ -1744,10 +1744,10 @@ map.on('click', function(evt){
|
||||
|
||||
if(feature.userData !== undefined && (feature.userData.type=="Product2" || feature.userData.type=="Product3" || feature.userData.type=="Product2r" || feature.userData.type=="Product3r"))
|
||||
{
|
||||
if(feature.userData.percent!='')
|
||||
//if(feature.userData.percent!='')
|
||||
new TChartFRMLocustInfo(feature.userData);
|
||||
else
|
||||
alert2(trt('Alert'),trt('No_data')+'!',feature.userData.name);
|
||||
//else
|
||||
// alert2(trt('Alert'),trt('No_data')+'!',feature.userData.name);
|
||||
}
|
||||
|
||||
if(feature.userData !== undefined && (feature.userData.type=="Product4" || feature.userData.type=="Product4r"))
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -18,8 +18,8 @@
|
||||
<body>
|
||||
|
||||
<h3>ASDC Guidelines</h3>
|
||||
<a href="ASDC_for_Android_ENG.pdf" target="_blank">ASDC_for_Android_ENG_v2.3.pdf</a><br/>
|
||||
<a href="ASDC_for_Android_RUS.pdf" target="_blank">ASDC_for_Android_RUS_v2.3.pdf</a>
|
||||
<a href="ASDC_for_Android_ENG.pdf" target="_blank">ASDC_for_Android_ENG_v2.4.3.pdf</a><br/>
|
||||
<a href="ASDC_for_Android_RUS.pdf" target="_blank">ASDC_for_Android_RUS_v2.4.3.pdf</a>
|
||||
|
||||
<h3>CCALM Guidelines</h3>
|
||||
<a href="CCALM_help_ENG.pdf" target="_blank">CCALM_help_ENG.pdf</a><br/>
|
||||
|
||||
@ -38,7 +38,7 @@ function showIFrameWindow(title,url)
|
||||
function showConfigWidget()
|
||||
{
|
||||
this.win=new TWin();
|
||||
this.win.BuildGUI(10,10);
|
||||
this.win.BuildGUI(350,140);
|
||||
this.win.setCaption(trt('Settings'));
|
||||
|
||||
let str=`<div style="width: 100%; height: 100%; padding: 3px; text-align: left;">
|
||||
@ -65,7 +65,7 @@ function showConfigWidget()
|
||||
</table>
|
||||
</div>`;
|
||||
|
||||
this.win.setSize("420px","50px");
|
||||
this.win.setSize("400px","140px");
|
||||
this.win.setContent(str);
|
||||
this.win.setCenter();
|
||||
this.win.shadow=true;
|
||||
@ -451,12 +451,22 @@ function downloadQGISFile(product)
|
||||
}
|
||||
|
||||
//Class for making chart from "frmLocustInfo" table
|
||||
function TChartFRMLocustInfo(userData)
|
||||
class TChartFRMLocustInfo
|
||||
{
|
||||
this.updateData = function()
|
||||
constructor(userData) {
|
||||
this.name='TChartFRMLocustInfo';
|
||||
this.userData = userData;
|
||||
this.m_win=null;
|
||||
this.m_arr = new Array()
|
||||
this.m_uid = getUID();
|
||||
|
||||
this.callData();
|
||||
}
|
||||
|
||||
updateData()
|
||||
{
|
||||
this.m_win.setSize("150px","100px");
|
||||
var str='';
|
||||
let str='';
|
||||
str='<div style="font-size:12px; position:relative;">\n\
|
||||
<div id="tit_'+this.m_uid+'" style="font-weight:bold;"> </div>\n\
|
||||
<table id="tbl_'+this.m_uid+'" border="1" style="font-size:inherit; border-collapse:collapse;">\n\
|
||||
@ -473,27 +483,26 @@ function TChartFRMLocustInfo(userData)
|
||||
this.m_win.hideProgressBar();
|
||||
}
|
||||
|
||||
this.addField = function(year,val)
|
||||
addField(year,val)
|
||||
{
|
||||
this.m_arr[year]=val;
|
||||
}
|
||||
|
||||
this.buildTable = function(year,currVal)
|
||||
buildTable(year,currVal,txt)
|
||||
{
|
||||
var tbl=document.getElementById("tbl_"+this.m_uid);
|
||||
var tblb=document.getElementById("tblb_"+this.m_uid);
|
||||
for(var i = 0; i < tblb.rows.length;)
|
||||
let tbl=document.getElementById("tbl_"+this.m_uid);
|
||||
let tblb=document.getElementById("tblb_"+this.m_uid);
|
||||
for(let i = 0; i < tblb.rows.length;)
|
||||
{
|
||||
tblb.deleteRow(i);
|
||||
}
|
||||
//tbl.innerHTML='<thead style="background: #aaaaaa;"><tr style="border: 1px solid black;"><td style="border: 1px solid black;">'+trt('Year')+'</td><td style="border: 1px solid black;"> .2. </td><td style="border: 1px solid black;">'+trt('Value')+'</td></tr></thead><tbody></tbody>';
|
||||
|
||||
var max=currVal;
|
||||
var average=0;
|
||||
var cnt=0;
|
||||
let max=parseFloat(currVal);
|
||||
let average=0;
|
||||
let cnt=0;
|
||||
|
||||
//Calculating average value
|
||||
for (var key in this.m_arr)
|
||||
for (let key in this.m_arr)
|
||||
{
|
||||
if (this.m_arr.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294)
|
||||
{
|
||||
@ -504,21 +513,20 @@ function TChartFRMLocustInfo(userData)
|
||||
}
|
||||
}
|
||||
average=average/cnt;
|
||||
let pr=100/max;
|
||||
|
||||
var pr=100/max;
|
||||
|
||||
for (var key in this.m_arr)
|
||||
for(let key in this.m_arr)
|
||||
{
|
||||
if (this.m_arr.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294)
|
||||
{
|
||||
var tr; var div;
|
||||
let tr; let div;
|
||||
tr = document.createElement('tr');
|
||||
|
||||
var td1 = document.createElement('td');
|
||||
let td1 = document.createElement('td');
|
||||
td1.appendChild(document.createTextNode(key));
|
||||
tr.appendChild(td1);
|
||||
|
||||
var td2 = document.createElement('td');
|
||||
let td2 = document.createElement('td');
|
||||
td2.style.cssText='width:100px;height:100%;padding:1px;';
|
||||
div = document.createElement('td');
|
||||
div.style.cssText='height:15px; background-color:#9999ff; display:inline-block;';
|
||||
@ -526,71 +534,76 @@ function TChartFRMLocustInfo(userData)
|
||||
td2.appendChild(div);
|
||||
tr.appendChild(td2);
|
||||
|
||||
var td3 = document.createElement('td');
|
||||
let td3 = document.createElement('td');
|
||||
td3.appendChild(document.createTextNode(this.m_arr[key]));
|
||||
tr.appendChild(td3);
|
||||
|
||||
var td4 = document.createElement('td');
|
||||
let td4 = document.createElement('td');
|
||||
td4.appendChild(document.createTextNode((Math.round((this.m_arr[key]/average-1)*1000)/10)+"%"));
|
||||
tr.appendChild(td4);
|
||||
|
||||
tblb.appendChild(tr);
|
||||
}
|
||||
}
|
||||
|
||||
//For last value
|
||||
var tr; var div;
|
||||
let tr; let div;
|
||||
tr = document.createElement('tr');
|
||||
|
||||
var td1 = document.createElement('td');
|
||||
let td1 = document.createElement('td');
|
||||
td1.appendChild(document.createTextNode(year));
|
||||
tr.appendChild(td1);
|
||||
|
||||
var td2 = document.createElement('td');
|
||||
let td2 = document.createElement('td');
|
||||
td2.style.cssText='width:100px;height:100%;padding:1px;';
|
||||
div = document.createElement('td');
|
||||
div.style.cssText='height:15px; background-color:#9999ff; display:inline-block;';
|
||||
div.style.width = Math.round(currVal*pr)+"px";
|
||||
div.style.width = Math.round(parseFloat(currVal)*pr)+"px";
|
||||
td2.appendChild(div);
|
||||
tr.appendChild(td2);
|
||||
|
||||
var td3 = document.createElement('td');
|
||||
td3.appendChild(document.createTextNode(currVal));
|
||||
let td3 = document.createElement('td');
|
||||
if(txt!='')
|
||||
td3.appendChild(document.createTextNode(txt));
|
||||
else
|
||||
td3.appendChild(document.createTextNode(currVal));
|
||||
tr.appendChild(td3);
|
||||
tblb.appendChild(tr);
|
||||
|
||||
var td4 = document.createElement('td');
|
||||
td4.appendChild(document.createTextNode((Math.round((currVal/average-1)*1000)/10)+"%"));
|
||||
let td4 = document.createElement('td');
|
||||
td4.appendChild(document.createTextNode((Math.round((parseFloat(currVal)/average-1)*1000)/10)+"%"));
|
||||
tr.appendChild(td4);
|
||||
|
||||
var eTit=document.getElementById("tit_"+this.m_uid);
|
||||
let eTit=document.getElementById("tit_"+this.m_uid);
|
||||
eTit.innerHTML=this.userData.name;
|
||||
|
||||
let p=(parseFloat(currVal)/average-1)*100;
|
||||
|
||||
var p=(currVal/average-1)*100;
|
||||
|
||||
var eTxt=document.getElementById("txt_"+this.m_uid);
|
||||
let eTxt=document.getElementById("txt_"+this.m_uid);
|
||||
eTxt.innerHTML=trt('Average')+': '+(Math.round(average * 100) / 100)+' ('+trt('thous_ha')+')<br>'+trt('Deviation')+': '+(Math.round(p * 10) / 10)+'%';
|
||||
|
||||
//var crd=ElemCoords(tbl);
|
||||
|
||||
var eLin=document.getElementById("lin_"+this.m_uid);
|
||||
eLin.style.top = (tbl.offsetTop + (tbl.offsetHeight/(cnt+1)))+"px";
|
||||
eLin.style.left = td2.offsetLeft+(average*pr)+"px";
|
||||
|
||||
eLin.style.height = (tbl.offsetHeight - 2*(tbl.offsetHeight/(cnt+1)))+"px";
|
||||
if(this.m_arr.length<=1){
|
||||
let eLin=document.getElementById("lin_"+this.m_uid);
|
||||
eLin.style.visibility='hidden';
|
||||
}else{
|
||||
let eLin=document.getElementById("lin_"+this.m_uid);
|
||||
eLin.style.top = (tbl.offsetTop + (tbl.offsetHeight/(cnt+1)))+"px";
|
||||
eLin.style.left = td2.offsetLeft+(average*pr)+"px";
|
||||
eLin.style.height = (tbl.offsetHeight - 2*(tbl.offsetHeight/(cnt+1)))+"px";
|
||||
}
|
||||
}
|
||||
|
||||
this.prepareData = function(obj)
|
||||
prepareData(obj)
|
||||
{
|
||||
let find=false;
|
||||
for(let i=0;i<obj.data.length;i++){
|
||||
year=obj.data[i].row[0];
|
||||
inspect=parseFloat(obj.data[i].row[1]);
|
||||
infested_etd=parseFloat(obj.data[i].row[2]);
|
||||
treated=parseFloat(obj.data[i].row[3]);
|
||||
let year=obj.data[i].row[0];
|
||||
let inspect=parseFloat(obj.data[i].row[1]);
|
||||
let infested_etd=parseFloat(obj.data[i].row[2]);
|
||||
let treated=parseFloat(obj.data[i].row[3]);
|
||||
|
||||
if(!isNaN(infested_etd))
|
||||
{
|
||||
//alert('add year = '+year);
|
||||
if(this.userData.year!=year)
|
||||
{
|
||||
if(this.userData.type=="Product2" || this.userData.type=="Product2r")
|
||||
@ -603,16 +616,27 @@ function TChartFRMLocustInfo(userData)
|
||||
this.updateData();
|
||||
if(this.userData.type=="Product2" || this.userData.type=="Product2r")
|
||||
{
|
||||
this.buildTable(year,infested_etd);
|
||||
this.buildTable(year,infested_etd,'');
|
||||
}else if(this.userData.type=="Product3" || this.userData.type=="Product3r")
|
||||
{ this.buildTable(year,treated);
|
||||
{ this.buildTable(year,treated,'');
|
||||
}
|
||||
find=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
//Если в данных нет иследуемого года
|
||||
if(!find){
|
||||
this.updateData();
|
||||
if(this.userData.type=="Product2" || this.userData.type=="Product2r")
|
||||
{
|
||||
this.buildTable(this.userData.year,0,'none');
|
||||
}else if(this.userData.type=="Product3" || this.userData.type=="Product3r")
|
||||
{ this.buildTable(this.userData.year,0,'none');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.callData = function()
|
||||
callData()
|
||||
{
|
||||
this.m_win = new TWin();
|
||||
this.m_win.BuildGUI(pageX,pageY);
|
||||
@ -620,7 +644,7 @@ function TChartFRMLocustInfo(userData)
|
||||
this.m_win.setSize("220px","100px");
|
||||
this.m_win.setCenter();
|
||||
|
||||
var xs='';
|
||||
let xs='';
|
||||
if(typeof this.userData.region_id != 'undefined' )
|
||||
{
|
||||
xs='<?xml version="1.0" encoding="utf-8"?>\n\
|
||||
@ -648,16 +672,16 @@ function TChartFRMLocustInfo(userData)
|
||||
</type>\n\
|
||||
</metadata>';
|
||||
}
|
||||
var request=new TRequest(this);
|
||||
let request=new TRequest(this);
|
||||
if(request.callServer(ScriptName,xs))
|
||||
{
|
||||
this.m_win.showProgressBar();
|
||||
}
|
||||
|
||||
this.m_win.hide(false);
|
||||
};
|
||||
}
|
||||
|
||||
this.applyReq = function(req,fn,node)
|
||||
applyReq(req,fn,node)
|
||||
{
|
||||
if(node.errorCode>0) {
|
||||
let fullText = node.errorMessage;
|
||||
@ -691,15 +715,7 @@ function TChartFRMLocustInfo(userData)
|
||||
}
|
||||
}else
|
||||
alert("Unknown function! fn=\""+fn+"\"");
|
||||
};
|
||||
|
||||
this.name='TChartFRMLocustInfo';
|
||||
this.userData = userData;
|
||||
this.m_win=null;
|
||||
this.m_arr = new Array()
|
||||
this.m_uid = getUID();
|
||||
|
||||
this.callData();
|
||||
}
|
||||
}
|
||||
|
||||
//Customize the visual elements on the access level.
|
||||
|
||||
Reference in New Issue
Block a user