Commit dac0360c6cf8fa24dfff8718d1c2a7893a67a285
1 parent
cb46e146
Exists in
master
and in
7 other branches
Melhorcaminho raster
Showing
6 changed files
with
143 additions
and
70 deletions
Show diff stats
css/corrigeyui_geral.css
| ... | ... | @@ -250,6 +250,18 @@ td.ygtvcell { |
| 250 | 250 | width: 100px; |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | +.rodar0 .first-child button { | |
| 254 | + background: url("../imagens/oxygen/16x16/run-build.png") no-repeat scroll 50% 50% rgba(0, 0, 0, 0); | |
| 255 | + width: 20px; | |
| 256 | + height: 20px; | |
| 257 | +} | |
| 258 | + | |
| 259 | +.adicionar0 .first-child button { | |
| 260 | + background: url("../imagens/oxygen/16x16/list-add.png") no-repeat scroll 50% 50% rgba(0, 0, 0, 0); | |
| 261 | + width: 20px; | |
| 262 | + height: 20px; | |
| 263 | +} | |
| 264 | + | |
| 253 | 265 | .enviar .first-child button { |
| 254 | 266 | background: url(../imagens/oxygen/16x16/svn-commit.png) 5% 50% no-repeat; |
| 255 | 267 | width: 250px; | ... | ... |
css/geral.css
| ... | ... | @@ -1284,6 +1284,18 @@ h1 { |
| 1284 | 1284 | } |
| 1285 | 1285 | } |
| 1286 | 1286 | |
| 1287 | +.i3geoFormTag { | |
| 1288 | + background: transparent url("../imagens/oxygen/16x16/list-remove.png") no-repeat scroll 100% 3px; | |
| 1289 | + @media (-webkit-min-device-pixel-ratio: 2), | |
| 1290 | + (min-resolution: 192dpi) { | |
| 1291 | + background: transparent url("../imagens/oxygen/16x16/list-remove.png") no-repeat scroll 100% 3px; | |
| 1292 | + background-size: 16px 144px; | |
| 1293 | + } | |
| 1294 | + border-radius: 8px; | |
| 1295 | + background-color: #F0F0F0; | |
| 1296 | + cursor: pointer; | |
| 1297 | +} | |
| 1298 | + | |
| 1287 | 1299 | .i3geoFormIconeAquarela { |
| 1288 | 1300 | cursor: pointer; |
| 1289 | 1301 | background: transparent url("../imagens/aquarela.gif") no-repeat scroll 98% 5px; | ... | ... |
ferramentas/melhorcaminho/dicionario.js
| ... | ... | @@ -54,5 +54,45 @@ i3GEOF.melhorcaminho.dicionario = { |
| 54 | 54 | pt : "Ponto final (B). Você pode clicar no mapa ou digitar novos valores", |
| 55 | 55 | en : "", |
| 56 | 56 | es : "" |
| 57 | + } ], | |
| 58 | + 'lut' : [ { | |
| 59 | + pt : "Você pode reclassificar a imagem definindo novos valores para os pixels. Escolha os valores iniciais e finais do original e o novo valor. Podem ser definidos vários valores.", | |
| 60 | + en : "", | |
| 61 | + es : "" | |
| 62 | + } ], | |
| 63 | + 'novovalor' : [ { | |
| 64 | + pt : "novo valor", | |
| 65 | + en : "", | |
| 66 | + es : "" | |
| 67 | + } ], | |
| 68 | + 'menorque' : [ { | |
| 69 | + pt : "menor que", | |
| 70 | + en : "", | |
| 71 | + es : "" | |
| 72 | + } ], | |
| 73 | + 'maiorque' : [ { | |
| 74 | + pt : "igual ou maior que", | |
| 75 | + en : "", | |
| 76 | + es : "" | |
| 77 | + } ], | |
| 78 | + 'executa' : [ { | |
| 79 | + pt : "Calcular", | |
| 80 | + en : "", | |
| 81 | + es : "" | |
| 82 | + } ], | |
| 83 | + 'fim' : [ { | |
| 84 | + pt : "Após calcular o melhor traçado, será adicionado ao mapa uma nova camada. O valor do custo calculado será incluído na tabela de atributos desse tema.", | |
| 85 | + en : "", | |
| 86 | + es : "" | |
| 87 | + } ], | |
| 88 | + 'mesf1' : [ { | |
| 89 | + pt : "Escolha um tema com o mapa de custo", | |
| 90 | + en : "", | |
| 91 | + es : "" | |
| 92 | + } ], | |
| 93 | + 'mesf2' : [ { | |
| 94 | + pt : "Erro ao calcular as coordenadas dos pontos A e B", | |
| 95 | + en : "", | |
| 96 | + es : "" | |
| 57 | 97 | } ] |
| 58 | 98 | }; | ... | ... |
ferramentas/melhorcaminho/index.js
| ... | ... | @@ -228,25 +228,49 @@ i3GEOF.melhorcaminho = { |
| 228 | 228 | $i("i3GEOmelhorcaminhoiys").value = dmsy[2]; |
| 229 | 229 | }, |
| 230 | 230 | t5: function(){ |
| 231 | - var ins = "<p class='paragrafo'><b>"+$trad('numero',i3GEOF.melhorcaminho.dicionario)+"</b>"; | |
| 232 | - ins += "<p class='paragrafo'>X</p>"; | |
| 233 | - ins += "<div class='i3geoForm i3geoFormIconeEdita' ><input id='i3GEOmelhorcaminhonptx' title='pontos em x' type=text value='10'/></div>"; | |
| 234 | - ins += "<br><p class='paragrafo'>Y"; | |
| 235 | - ins += "<div class='i3geoForm i3geoFormIconeEdita' ><input id='i3GEOmelhorcaminhonpty' title='pontos em y' type=text value='10'/></div>"; | |
| 236 | - | |
| 237 | - i3GEO.util.proximoAnterior("i3GEOF.melhorcaminho.t2()","i3GEOF.melhorcaminho.t4()",ins,"i3GEOF.melhorcaminho.t3","i3GEOmelhorcaminhoresultado",true,"i3GEOF.melhorcaminho_rodape"); | |
| 231 | + var b, ins = "<p class='paragrafo'>"+$trad('lut',i3GEOF.melhorcaminho.dicionario); | |
| 232 | + ins += "<table><tr><td>"+$trad('maiorque',i3GEOF.melhorcaminho.dicionario)+"</td><td>"+$trad('menorque',i3GEOF.melhorcaminho.dicionario)+"</td><td>"+$trad('novovalor',i3GEOF.melhorcaminho.dicionario)+"</td><td></td></tr>"; | |
| 233 | + ins += "<tr>" | |
| 234 | + ins += "<td><div class='i3geoForm100' style='float:left;' ><input id='i3GEOmelhorcaminhoLut1' type=text value=''/></div> </td>"; | |
| 235 | + ins += "<td><div class='i3geoForm100' style='float:left;' ><input id='i3GEOmelhorcaminhoLut2' type=text value=''/></div> </td>"; | |
| 236 | + ins += "<td><div class='i3geoForm100' style='float:left;' ><input id='i3GEOmelhorcaminhoLut3' type=text value=''/></div></td>"; | |
| 237 | + ins += "<td><div><input id='i3GEOmelhorcaminhoLut4' type='button' value=' ' /></div></td>"; | |
| 238 | + ins += "</tr></table>"; | |
| 239 | + ins += "<br>"; | |
| 240 | + ins += "<div id='i3GEOmelhorcaminhoLut' ></div>"; | |
| 241 | + i3GEO.util.proximoAnterior("i3GEOF.melhorcaminho.t4()","i3GEOF.melhorcaminho.t6()",ins,"i3GEOF.melhorcaminho.t5","i3GEOmelhorcaminhoresultado",true,"i3GEOF.melhorcaminho_rodape"); | |
| 242 | + b = new YAHOO.widget.Button( | |
| 243 | + "i3GEOmelhorcaminhoLut4", | |
| 244 | + {onclick:{fn: i3GEOF.melhorcaminho.adicionaLut}} | |
| 245 | + ); | |
| 246 | + b.addClass("adicionar0"); | |
| 238 | 247 | }, |
| 239 | 248 | t6: function(){ |
| 240 | - var b,ins = "<p class='paragrafo'><b>"+$trad('adicionaTema',i3GEOF.melhorcaminho.dicionario)+"</b>"; | |
| 241 | - ins += "<p class='paragrafo'><input id=i3GEOmelhorcaminhobotao1 size=18 class=executar type='button' value='"+$trad('criaGrade',i3GEOF.melhorcaminho.dicionario)+"' />"; | |
| 242 | - | |
| 243 | - i3GEO.util.proximoAnterior("i3GEOF.melhorcaminho.t3()","",ins,"i3GEOF.melhorcaminho.t4","i3GEOmelhorcaminhoresultado",true,"i3GEOF.melhorcaminho_rodape"); | |
| 249 | + var b,ins = "<p class='paragrafo'><b>"+$trad('fim',i3GEOF.melhorcaminho.dicionario)+"</b>"; | |
| 250 | + ins += "<p class='paragrafo'><input id=i3GEOmelhorcaminhobotao1 size=18 class=executar type='button' value='"+$trad('executa',i3GEOF.melhorcaminho.dicionario)+"' />"; | |
| 251 | + i3GEO.util.proximoAnterior("i3GEOF.melhorcaminho.t5()","",ins,"i3GEOF.melhorcaminho.t6","i3GEOmelhorcaminhoresultado",true,"i3GEOF.melhorcaminho_rodape"); | |
| 244 | 252 | b = new YAHOO.widget.Button( |
| 245 | 253 | "i3GEOmelhorcaminhobotao1", |
| 246 | - {onclick:{fn: i3GEOF.melhorcaminho.criaGrade}} | |
| 254 | + {onclick:{fn: i3GEOF.melhorcaminho.executa}} | |
| 247 | 255 | ); |
| 248 | 256 | b.addClass("rodar"); |
| 249 | 257 | }, |
| 258 | + adicionaLut: function(){ | |
| 259 | + var v1, v2, v3, onde, novo, v, n; | |
| 260 | + v1 = $i("i3GEOmelhorcaminhoLut1").value; | |
| 261 | + v2 = $i("i3GEOmelhorcaminhoLut2").value; | |
| 262 | + v3 = $i("i3GEOmelhorcaminhoLut3").value; | |
| 263 | + v = ">= " + v1 + "e < " + v2 + " = " + v3; | |
| 264 | + n = v1 + "," + v2 + "," + v3; | |
| 265 | + onde = $i("i3GEOmelhorcaminhoLut"); | |
| 266 | + novo = "<div class='i3geoForm150 i3geoFormTag' style='float:left;margin-left:2px;margin-top:2px;' onclick='i3GEOF.melhorcaminho.removeLut(this)'>" | |
| 267 | + + "<input name='" + n +"'type=text value='" + v + "' />" | |
| 268 | + + "</div>"; | |
| 269 | + onde.innerHTML += novo; | |
| 270 | + }, | |
| 271 | + removeLut: function(obj){ | |
| 272 | + obj.parentNode.removeChild(obj); | |
| 273 | + }, | |
| 250 | 274 | comboTemasRaster: function(){ |
| 251 | 275 | i3GEO.util.comboTemas( |
| 252 | 276 | "i3GEOmelhorcaminhoRaster", |
| ... | ... | @@ -315,66 +339,51 @@ i3GEOF.melhorcaminho = { |
| 315 | 339 | ); |
| 316 | 340 | }, |
| 317 | 341 | /* |
| 318 | - Function: criaGrade | |
| 319 | - | |
| 320 | - Cria a grade e adiciona um novo tema ao mapa | |
| 321 | - | |
| 322 | - Veja: | |
| 323 | - | |
| 324 | - <GRADEDEPOL> | |
| 342 | + Function: executa | |
| 325 | 343 | */ |
| 326 | - criaGrade: function(){ | |
| 327 | - try{ | |
| 328 | - if(i3GEOF.melhorcaminho.aguarde.visibility === "visible") | |
| 329 | - {return;} | |
| 330 | - i3GEOF.melhorcaminho.aguarde.visibility = "visible"; | |
| 331 | - var dx,dy,ix,iy,nptx,npty,fim,p,cp,proj="nao"; | |
| 332 | - if(!$i("i3GEOmelhorcaminhoProj").checked){ | |
| 333 | - dx = i3GEO.calculo.dms2dd($i("i3GEOmelhorcaminhoxg").value,$i("i3GEOmelhorcaminhoxm").value,$i("i3GEOmelhorcaminhoxs").value); | |
| 334 | - dy = i3GEO.calculo.dms2dd($i("i3GEOmelhorcaminhoyg").value,$i("i3GEOmelhorcaminhoym").value,$i("i3GEOmelhorcaminhoys").value); | |
| 335 | - } | |
| 336 | - else{ | |
| 337 | - proj = "sim"; | |
| 338 | - dx = $i("i3GEOmelhorcaminhoxg").value; | |
| 339 | - dy = $i("i3GEOmelhorcaminhoyg").value; | |
| 344 | + executa: function(){ | |
| 345 | + if(i3GEOF.melhorcaminho.aguarde.visibility === "visible") | |
| 346 | + {return;} | |
| 347 | + var raster = "",ptax,ptbx,ptby,ptby,pta,ptb,lut=[],lutObjs,n,i; | |
| 348 | + //pega tema com raster | |
| 349 | + if($i("i3GEOmelhorcaminhoRaster")){ | |
| 350 | + raster = $i("i3GEOmelhorcaminhoRaster").value; | |
| 351 | + if(raster === ""){ | |
| 352 | + i3GEO.janela.tempoMsg($trad('mesf1',i3GEOF.melhorcaminho.dicionario));return; | |
| 340 | 353 | } |
| 341 | - ix = i3GEO.calculo.dms2dd($i("i3GEOmelhorcaminhoixg").value,$i("i3GEOmelhorcaminhoixm").value,$i("i3GEOmelhorcaminhoixs").value); | |
| 342 | - iy = i3GEO.calculo.dms2dd($i("i3GEOmelhorcaminhoiyg").value,$i("i3GEOmelhorcaminhoiym").value,$i("i3GEOmelhorcaminhoiys").value); | |
| 343 | - nptx = $i("i3GEOmelhorcaminhonptx").value; | |
| 344 | - npty = $i("i3GEOmelhorcaminhonpty").value; | |
| 345 | - if ((dx == 0) || (dy == 0)) | |
| 346 | - {i3GEO.janela.tempoMsg($trad('msg',i3GEOF.melhorcaminho.dicionario));return;} | |
| 347 | - if ((nptx == 0) || (npty == 0)) | |
| 348 | - {i3GEO.janela.tempoMsg($trad('msg2',i3GEOF.melhorcaminho.dicionario));return;} | |
| 349 | - if (nptx * npty > 10000) | |
| 350 | - {i3GEO.janela.tempoMsg($trad('msg2',i3GEOF.melhorcaminho.dicionario));return;} | |
| 351 | - fim = function(retorno){ | |
| 352 | - i3GEOF.melhorcaminho.aguarde.visibility = "hidden"; | |
| 353 | - if (retorno.data == undefined ) | |
| 354 | - {$i("i3GEOmelhorcaminhofim").innerHTML = "<p class='paragrafo'>Erro. ";} | |
| 355 | - else | |
| 356 | - {i3GEO.atualiza("");} | |
| 357 | - }; | |
| 358 | - p = i3GEO.configura.locaplic+"/ferramentas/melhorcaminho/exec.php?g_sid="+i3GEO.configura.sid+"&proj="+proj+"&funcao=gradedepol&xdd="+dx+"&ydd="+dy+"&px="+ix+"&py="+iy+"&nptx="+nptx+"&npty="+npty; | |
| 359 | - cp = new cpaint(); | |
| 360 | - cp.set_response_type("JSON"); | |
| 361 | - cp.call(p,"melhorcaminho",fim); | |
| 362 | 354 | } |
| 363 | - catch(e){$i("i3GEOmelhorcaminhofim").innerHTML = "<p class='paragrafo' >Erro. "+e;i3GEOF.melhorcaminho.aguarde.visibility = "hidden";} | |
| 364 | - }, | |
| 365 | - /* | |
| 366 | - Function: capturaPonto | |
| 367 | - | |
| 368 | - Captura um ponto no mapa e preenche os campos de coordenadas de início da grade | |
| 369 | - */ | |
| 370 | - capturaPonto: function(){ | |
| 371 | - i3GEO.eventos.cliqueCapturaPt( | |
| 372 | - "i3GEOmelhorcaminhoixg", | |
| 373 | - "i3GEOmelhorcaminhoixm", | |
| 374 | - "i3GEOmelhorcaminhoixs", | |
| 375 | - "i3GEOmelhorcaminhoiyg", | |
| 376 | - "i3GEOmelhorcaminhoiym", | |
| 377 | - "i3GEOmelhorcaminhoiys" | |
| 378 | - ); | |
| 355 | + else{ | |
| 356 | + //i3GEO.janela.tempoMsg($trad('mesf1',i3GEOF.melhorcaminho.dicionario));return; | |
| 357 | + } | |
| 358 | + //pega pontos A e B | |
| 359 | + try{ | |
| 360 | + ptax = i3GEO.calculo.dms2dd($i("i3GEOmelhorcaminhoxg").value,$i("i3GEOmelhorcaminhoxm").value,$i("i3GEOmelhorcaminhoxs").value); | |
| 361 | + ptay = i3GEO.calculo.dms2dd($i("i3GEOmelhorcaminhoyg").value,$i("i3GEOmelhorcaminhoym").value,$i("i3GEOmelhorcaminhoys").value); | |
| 362 | + ptbx = i3GEO.calculo.dms2dd($i("i3GEOmelhorcaminhoixg").value,$i("i3GEOmelhorcaminhoixm").value,$i("i3GEOmelhorcaminhoixs").value); | |
| 363 | + ptby = i3GEO.calculo.dms2dd($i("i3GEOmelhorcaminhoiyg").value,$i("i3GEOmelhorcaminhoiym").value,$i("i3GEOmelhorcaminhoiys").value); | |
| 364 | + pta = ptax+","+ptay; | |
| 365 | + ptb = ptbx+","+ptby; | |
| 366 | + } catch(e){ | |
| 367 | + i3GEO.janela.tempoMsg($trad('mesf2',i3GEOF.melhorcaminho.dicionario));return; | |
| 368 | + } | |
| 369 | + //pega lut | |
| 370 | + lutObjs = $i("i3GEOmelhorcaminhoLut").getElementsByTagName("input"); | |
| 371 | + n = lutObjs.length; | |
| 372 | + for(i=0;i<n;i++){ | |
| 373 | + lut.push(lutObjs[i].name); | |
| 374 | + } | |
| 375 | + lut = lut.join("|"); | |
| 376 | + /* | |
| 377 | + i3GEOF.melhorcaminho.aguarde.visibility = "visible"; | |
| 378 | + fim = function(retorno){ | |
| 379 | + i3GEOF.melhorcaminho.aguarde.visibility = "hidden"; | |
| 380 | + i3GEO.atualiza(""); | |
| 381 | + }; | |
| 382 | + p = i3GEO.configura.locaplic+"/ferramentas/melhorcaminho/exec.php?g_sid="+i3GEO.configura.sid+"&proj="+proj+"&funcao=gradedepol&xdd="+dx+"&ydd="+dy+"&px="+ix+"&py="+iy+"&nptx="+nptx+"&npty="+npty; | |
| 383 | + cp = new cpaint(); | |
| 384 | + cp.set_response_type("JSON"); | |
| 385 | + cp.call(p,"melhorcaminho",fim); | |
| 386 | + */ | |
| 387 | + alert("Tema: "+raster+"<br>A: "+pta+"<br>B: "+ptb+"<br>Lut: "+lut); | |
| 379 | 388 | } |
| 380 | 389 | }; | ... | ... |
564 Bytes
332 Bytes