Jump to content

Fifcok

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Fifcok

  1. Hello,

     

    I written short code whith contains calculator to calculate wind on takeoff (headwind / tailwind)

     

    I would like to add this as module or as my own code, is it possible?

     

    It looks as below:

    image.png.2fbfdee6b04a711ce0cef0aa7de6dcb8.png

     

    I would like use it as module?:

     

    image.png.1c4b29e40c0a91be0b9b0bc902586acc.png

     

    Code:

     

    <!DOCTYPE html>
    <html>
    <head>
    <title>Kalkulator wiatru</title>
    <meta charset="utf-8" />
    
    <style type="text/css">
    #calculator {
        background: #eaeaea;
        margin: 0 auto;
        padding: 35px 25px 35px 25px;
        width: 200px;
        text-align: center;
    }
    #calculator button {
        padding: 10px;
        width: 100px;
    }
    #calculator input[type="number"] {
        padding: 10px;
        width: 147px;
        margin-bottom: 5px;
    }
    #calculator input[type="text"] {
        padding: 10px;
        width: 147px;
        margin-bottom: 5px;
    }
    </style>
    
    <script>
    function Calculator(operator) 
    {
        var a = parseInt(document.getElementById('a').value);
        var b = parseInt(document.getElementById('b').value);
    	var c = parseInt(document.getElementById('c').value);  
    
    	 
        switch(operator)
        {
            case 'Licz':
            if (a >= b) {
    							
    			var kat = parseFloat(a) - parseFloat(b);
    			
    			if (kat == 90) {
    			
    				var wynik = 0;
    								}
    			else {
    			
    		    var cosin = Math.cos(kat * Math.PI / 180);
    			
    			var wynik = parseFloat(c) * cosin;
    			
    			var wynik2 = wynik.toFixed(2);
    
    			}
                }
            else {
    		
            	var kat = parseFloat(b) - parseFloat(a);
    			
    			if (kat == 90) {
    			
    				var wynik = 0;
    								}
    			else {
    			
    		    var cosin = Math.cos(kat  * Math.PI / 180);
    			
    			var wynik = parseFloat(c) * cosin;
    			
    			var wynik2 = wynik.toFixed(2);
            }
    		}
    		
            break;  
        }
    	
    	if (wynik >= 0) {
    	
    		if (wynik == 0) {
    			var result = 0;
    			
    			document.getElementById('result').value = + result;
    			document.getElementById('wind').value = "HD";
    		}
    		else {
    			
    			var result = Math.abs(wynik2);
    		
    			document.getElementById('result').value = + result;
    			document.getElementById('wind').value = "HD";
    		}
    	}
    	else {
    	
    		var result = Math.abs(wynik2);
    		
    		document.getElementById('result').value = + result;
    		document.getElementById('wind').value = "TL";
    
    
    	}
    }
    </script>
    
    </head>
    <body>
    <form id="calculator">
    	<h2>Kalkulator wiatru (HD/TL)</h2>
    	Kierunek pasa [°]
        <input type="number" name="a" id="a" min="0" max="360" placeholder="HDG pasa" required/>
    	Kierunek wiatru [°]
        <input type="number" name="b" id="b" min="0" max="360" placeholder="Kierunek wiatru" required/>
    	Wiatr [knots]
    	<input type="number" name="c" id="c" min="0" placeholder="Siła wiatru" required/>
    	
    	Wynik:
    	<input type="text" name="wind" id="wind" placeholder="" disabled="disabled" />
        <input type="number" name="result" id="result" placeholder="" disabled="disabled" />
    	<button type="button" onclick="Calculator(this.innerHTML)">Licz</button>
    </form>
    </body>
    </html>

     

  2. Hello,

     

    my ACARS miss position "on runway" and it causes to haven't got 100 points in flight. There is problem with strobe and landing lights while I am on runway. I all my aircrafts.

     

    Whats more, I saw that ACARS show gates where you start flight and where you finish, it doesn't work for me.

     

    How to fix it?

     

    Version ACARS: 1.0.0.1920

×
×
  • Create New...