# Need help creating program



## Guest (Sep 25, 2008)

Hello all,

I would like to create a very very easy (for you guys probably) program.
Now I know really nothing about programming, so I was wondering if you could help me out here.

Attached is an excell file which I currently use to calculate the rate of descend for an aircraft. But it's not usefull to have to fill the data in everytime in that file.

Therefore what I'm looking for is a stand alone .exe that would:

1) Calculate the "Start Descend Distance". This after input of current and desired altitude, rate of descend and ground speed. (UPPER PART of .xls)

2) Calculate the "Rate of descend". This after input of current and desired altitude, distance and ground speed. (LOWER PART of .xls)

Could you help me with this fairly easy (if you know what you're doing that is) program ??

Any help appreciated

Vipersf


----------



## -Fabez- (Jul 28, 2008)

Should be easy to make some code for you


----------



## Guest (Sep 25, 2008)

I would be so gratefull !!!

Looking forward to seeing the .exe


----------



## Guest (Sep 26, 2008)

Any progress -Fabez - ?


----------



## Guest (Sep 27, 2008)

Bump


----------



## Guest (Sep 28, 2008)

bump


----------



## -Fabez- (Jul 28, 2008)

Could you post the equations for start dscent distance rate of decent please.


----------



## Guest (Sep 29, 2008)

-Fabez- i'm not sure what you mean so I will post everything I can offer you ... 
I hope this contains all you need !!

As said before:

The program should be able to do two options:

Option 1: Calculate the "Start Descend Distance". This after input of current and desired altitude, rate of descend and ground speed. (UPPER PART of .xls)

Option 2: Calculate the "Rate of descend". This after input of current and desired altitude, distance and ground speed. (LOWER PART of .xls)

In option 1:
Current Altitude (A2) = 
Desired Altitude (B2) = 
Rate of descend (C2) = 1800 (by default !)
Feet to descend (D2) = A2-B2
Time To Allow for Descent MM:SS (E2) = (((D2/C2)-INT(D2/C2))*0.6)+INT(D2/C2)
Ground Speed (Kts) (F2) = 
Distance (NM) covered per Minute (G2) = F2/60
Sart Descent Distance (NM) From Target (H2) = G2*(D2/C2)

In option 2:
Current Altitude (A7) = 
Desired Altitude (B7) = 
Rate of descend (C7) = (D7/E7)
Feet to descend (D7) = (A7-B7)
Time To Allow for Descent MM:SS (E7) = INT(H7/(F7/60))+((F7/60)-INT(F7/60))/0.6
Ground Speed (Kts) (F7) = 
Distance (NM) covered per Minute (G7) = F7/60
Sart Descent Distance (NM) From Target (H7) =


----------



## Guest (Oct 2, 2008)

bump


----------



## Guest (Oct 4, 2008)

bump


----------



## Guest (Oct 7, 2008)

bump


----------



## Archroom (Oct 7, 2008)

can anyone help me. i am new to this.

i want to save an excel worksheet as the content of a spacific cell. anyone know how.


----------



## Guest (Oct 7, 2008)

Hi Archroom,

Would you mind opening a new topic ?
General rule: 1 problem = 1 topic.

Welcome to TechGuy ... these people are very professional and I'm sure they'll help you out


----------



## Guest (Oct 9, 2008)

bump


----------



## -Fabez- (Jul 28, 2008)

The following is Python code, sorry it took so long. If you find any mistakes I will fix them, if you have any questions I will be happy to help you. The calculations may be incorrect as the way you posted them was slightly confusing, if so could you post the calculations again and I will correct them for you 


```
print "Plane Calc Program"
print "Please choose either one or two"
Choice=int(raw_input("Choice: "))
if Choice==1:
    print "Please answer the following questions"
    CurrentAlt=float(raw_input("Current Altitude: "))
    DesiredAlt=float(raw_input("Desired Alritude: "))
    RateOfDes=float(raw_input("Rate of desent: "))
    if RateOfDes=="":
        RateOfDes=1800
    FeetToDes=CurrentAlt-DesiredAlt
    TimeToDes=((FeetToDes/RateOfDes)-(FeetToDes/RateOfDes)*0.6)+(FeetToDes/RateOfDes)
    GroundSpeed=float(raw_input("Ground Speed: "))
    DistCoveredPerMin=GroundSpeed/60
    StartDesDist=DistCoveredPerMin*(FeetToDes/RateOfDes)
    print "Feet to desend: "
    print FeetToDes
    print "Time to desend: "
    print TimeToDes
    print "Distance covered per minute: "
    print DistCoveredPerMin
    print "Start desend distance from target: "
    print StartDesDist
elif Choice==2:
    print "Please answer the following questions"
    CurrentAlt=float(raw_input("Current Altitude: "))
    DesiredAlt=float(raw_input("Desired Alritude: "))
    StartDesDist=float(raw_input("Start desent distance: "))
    GroundSpeed=float(raw_input("Ground Speed: "))
    FeetToDes=CurrentAlt-DesiredAlt
    TimeToDes=StartDesDist/(GroundSpeed/60)+(GroundSpeed/60)-(GroundSpeed/60)/0.6
    RateOfDes=(FeetToDes/TimeToDes)
    DistCoveredPerMin=GroundSpeed/60
    print "Feet to desend: "
    print FeetToDes
    print "Time to desend: "
    print TimeToDes
    print "Rate of a desent: "
    print RateOfDes
    print "Distance covered per minute: "
    print DistCoveredPerMin
```


----------



## Guest (Oct 10, 2008)

how do I put this code in an exe now ? ;-)
Remember I'm a noob ;-)


----------



## -Fabez- (Jul 28, 2008)

It does not need to be compiled into an .Exe it can be run by Python, but it is possible to make it into a .Exe if you really need to. Just out of interest what is it for ?


----------



## Guest (Oct 11, 2008)

It should be a stand alone .exe that we can distribute among our members.
So I would prefer a stand alone exe, since most of the members do not have/wish to install Python (probably).


----------



## Guest (Oct 16, 2008)

bump


----------



## -Fabez- (Jul 28, 2008)

In order to compile the Python file you will need Python and Py2Exe. I cant attach .Exe files, but I will tell you how to do it


----------



## Guest (Oct 21, 2008)

-Fabez-, you can upload an .exe if you put in in a .zip or .rar. I think this is possible, but anyway ... if this would fail I have installed Python and Py2exe so I'm awaiting your instructions.


----------



## -Fabez- (Jul 28, 2008)

Its to big to upload, sorry. I will post instructions instead. Make a new Python file and copy and paste this code in.


```
from distutils.core import setup
import py2exe

target = {
    'script': 'Flight.py',
}

setup(console=[target],
    name="Flight",
    options = {'py2exe': {"bundle_files": 1, }},
    zipfile=None
)
```
Save this as make.Py file in the same directory as my .Py code. Rename my .Py code to Flight.py.then copy both of them to C:. Next open a command prompt and type the following commands.


```
cd c:
c:\python25\python.exe c:\make.py py2exe
pause
```
After the process has finished, you will find a C:\Dist directory with the .Exe in. If you have any questions, just ask


----------



## Guest (Oct 25, 2008)

Something doesn't work ....
See attachment


----------



## -Fabez- (Jul 28, 2008)

From what I can see you are using Python 2.6, so try using Python 2.5 instead. Also try using the cd c:\ command in the command prompt before you start the build.


----------



## Guest (Oct 25, 2008)

Still dito ....


----------

