Skip to content

Commit

Permalink
build for hvacengi's new pidloop and steeringhelper
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunbaratu committed Sep 17, 2015
1 parent 96375df commit bc996c9
Show file tree
Hide file tree
Showing 59 changed files with 3,376 additions and 481 deletions.
Binary file added _images/disk_space_slider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions _sources/addons/IR.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ Access structure IRAddon via `ADDONS:IR`.
:attr:`ISFREEMOVING` bool (readonly) True if Servo is uncontrollable (ex. docking washer)
:attr:`LOCKED` bool Servo's locked status, set true to lock servo.
:attr:`INVERTED` bool Servo's inverted status, set true to invert servo's axis.
:attr:`PART` :struct:`Part` A reference to a Part containing servo module.

:meth:`MOVERIGHT()` void Commands servo to move in positive direction
:meth:`MOVELEFT()` void Commands servo to move in negative direction
Expand Down Expand Up @@ -316,6 +317,13 @@ Access structure IRAddon via `ADDONS:IR`.

Servo's inverted status, set true to invert servo's axis.

.. attribute:: IRServo:PART

:type: :struct:`Part`
:access: Get

Returns reference to the :struct:`Part` containing servo module. Please note that Part:UID does not equal IRServo:UID.


.. method:: IRServo:MOVERIGHT()

Expand Down
54 changes: 27 additions & 27 deletions _sources/bindings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ ANGULARVELOCITY Same as SHIP:ANGULARVEL
COMMRANGE Same as SHIP:COMMRANGE
MASS Same as SHIP:MASS
VERTICALSPEED Same as SHIP:VERTICALSPEED
SURFACESPEED Same as SHIP:SURFACESPEED
GROUNDSPEED Same as SHIP:GROUNDSPEED
SURFACESPEED This has been obsoleted as of kOS 0.18.0. Replace it with GROUNDSPEED.
AIRSPEED Same as SHIP:AIRSPEED
VESSELNAME Same as SHIP:VESSELNAME
ALTITUDE Same as SHIP:ALTITUDE
Expand Down Expand Up @@ -148,42 +149,41 @@ You can also get a list of all resources, either in SHIP: or STAGE: with the :RE
ALT ALIAS
---------

The special variable ALT is a unique exception. It behaves like a
structure with suffixes but it's actually a bit "fake" in that it's not
really a structure. The following terms are just exceptions that don't
fit anywhere else:
The special variable `ALT <structures/vessels/alt.html>`__ gives you
access to a few altitude predictions:

ALT:APOAPSIS

ALT:PERIAPSIS

ALT:RADAR

Further details are found on the `ALT page <structures/vessels/alt.html>`__ .

============== ======== ==========
Variable Type Meaning
============== ======== ==========
ALT:APOAPSIS number The altitude of the apoapsis of the current ship. Identical to SHIP:APOAPSIS.
ALT:PERIAPSIS number The altitude of the periapsis of the current ship. Identical to SHIP:PERIAPSIS.
ALT:RADAR number The altitude of the current ship above the terrain. Does not have an alias anywhere.
============== ======== ==========

ETA ALIAS
---------

The special variable ETA is a unique exception. It behaves like a
structure with suffixes but it's actually a bit "fake" in that it's not
really a structure. The following terms are just exceptions that don't
fit anywhere else:
The special variable `ETA <structures/vessels/eta.html>`__ gives you
access to a few time predictions:

ETA:APOAPSIS

ETA:PERIAPSIS

ETA:TRANSITION

============== ======== ==========
Variable Type Meaning
============== ======== ==========
ETA:APOAPSIS number seconds until SHIP will reach its apoapsis.
ETA:PERIAPSIS number seconds until SHIP will reach its periapsis.
ETA:TRANSITION number seconds until SHIP will leave its SOI to enter the SOI of another body.
============== ======== ==========
Further details are found on the `ETA page <structures/vessels/eta.html>`__ .

ENCOUNTER
---------

The body being encountered next by the current vessel. Returns the
special string "None" if there is no expected encounter, or an object of
type `Body <structures/celestial_bodies/body.html>`__ if an encounter is
expected.
The orbit patch describing the next encounter with a body the current
vessel will enter. If there is no such encounter coming, it will return
the special string "None". If there is an encounter coming, it will
return an object :ref:`of type Orbit <orbit>`. (i.e. to obtain the name
of the planet the encounter is with, you can do:
``print ENCOUNTER:BODY:NAME.``, for example.).

BOOLEAN TOGGLE FIELDS:
----------------------
Expand Down
2 changes: 1 addition & 1 deletion _sources/commands/flight/pilot.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Will ensure that the throttle will be 0 when execution stops. These suffixes all


.. _SHIP CONTROL PILOTMAINTHROTTLE:
.. object:: SHIP:CONTROL:MAINTHROTTLE
.. object:: SHIP:CONTROL:PILOTMAINTHROTTLE

Returns the pilot's input for the throttle. This is the only ``PILOT`` variable that is settable and is used to set the throttle upon termination of the current **kOS** program.

Expand Down
12 changes: 10 additions & 2 deletions _sources/commands/flight/systems.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ Ship Systems
============

.. _CONTROLFROM:
.. object:: SET somepart:CONTROLFROM TO (true|false).

If you have a handle on a part, from ``LIST PARTS``, you can select that part to set the orientation of the craft, just like using the "control from here" in the right-click menu in the game. For more information see :attr:`Part:CONTROLFROM`.
e.g.::

set somepart to ship:partstagged("my favorite docking port")[0].
somepart:CONTROLFROM().

If you have a handle on a part, from ``LIST PARTS``, you can select that part to set the orientation of the craft, just like using the "control from here" in the right-click menu in the game. For more information see :attr:`Part:CONTROLFROM`.
All vessels must have at least one "control from"
part on them somewhere, which is why there's no mechanism for un-setting
the "control from" setting other than to pick another part and set it
to that part instead.

.. global:: RCS

Expand Down
44 changes: 37 additions & 7 deletions _sources/general/volumes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,50 @@ A Volume is a small unit of disk storage that contains a single hard
drive with very limited storage capacity. It can store more than one
program on it. To simulate the sense that this game takes place at the
dawn of the space race with 1960's and 1970's technology, the storage
capacity of a volume is very limited. It can only store 10,000 bytes of
program text - less than 10 Kb The byte count of a program is just the
capacity of a volume is very limited.

For example, the CX-4181 Scriptable Control System part defaults to only
allowing 1000 bytes of storage.

The byte count of a program is just the
count of the characters in the source code text. Writing programs with
short cryptic variable names instead of long descriptive ones does save
space. This is old school programming, where squeezing every byte out
matters.
space, although you can also save space by compiling your programs to
KSM files where the variable names are only stored once in the file, but
that's another topic for another page.

Each of the computer parts that kOS supports have their own different default
storage capacity limits for their local volume. As you get better parts
higher up the tech tree, they come with bigger default size limits.

You can get more space by paying extra cost in money and mass
-------------------------------------------------------------

.. figure:: /_images/general/disk_space_slider.png

If you wish to have more disk space on your local volume, and are willing to
pay a little extra cost in money and in mass, you can use the disk space
slider in the vehicle assembly building to increase the limit.

Every part comes with 3 different multiplier options:

* 1x default size,
* 2x default size,
* 4x default size

The higher the multiplier the more mass it will
cost you, to represent that you're using old storage technology,
so it costs a lot of mass to have more storage.

The disk size is only settable like this in the assembly building. Once
you launch a vessel, its volume size is stuck the way it was when you
launched it.

Multiple Volumes on One Vessel
------------------------------

Each kOS CX-4181 Scriptable Control System part contains '''one''' such
volume inside it. Therefore to send a craft into space with more storage
capacity than 10,000 bytes requires putting multiple CX-4181 Scriptable
Control System parts on the craft.
volume inside it.

If you have multiple CX-4181 parts on the same craft, they are assumed
to be networked together on the same system, and capable of reading each
Expand Down
2 changes: 1 addition & 1 deletion _sources/language/features.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ User Functions

Kerboscript supports user functions which you can write yourself
and call from your own scripts. *These are not* :ref:`structure
methods <methods>` *(which as of this writing are a feature which
methods <features methods>` *(which as of this writing are a feature which
only works for the built-in kOS types, and are not yet supported
by the kerboscript language for user functions you write yourself).*

Expand Down
2 changes: 2 additions & 0 deletions _sources/structures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ A general discussion of structures :ref:`can be found here <language structures>
* :struct:`Iterator`
* :struct:`Terminal`
* :struct:`core`
* :struct:`PIDloop`
* :struct:`SteeringManager``
* :ref:`Colors <colors>`
* :ref:`Time <time>`
* :ref:`Drawing Vectors <vecdraw>`
Expand Down
51 changes: 9 additions & 42 deletions _sources/structures/celestial_bodies/atmosphere.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ A Structure closely tied to :struct:`Body` A variable of type :struct:`Atmospher
:type: scalar
:access: Get only

A math constant plugged into a formula to find atmosphere density (see below).
A math constant plugged into a formula to find atmosphere density.

.. attribute:: Atmosphere:SEALEVELPRESSURE

Expand All @@ -80,48 +80,15 @@ A Structure closely tied to :struct:`Body` A variable of type :struct:`Atmospher
Atmospheric Math
----------------

The atmospheric effects of a planet's air need to be calculated using some formulas. First off, be aware that atmosphere can be measured three different ways:

Atm
A multiple of the pressure at Kerbin sea level. An atmosphere of 0.5 is half as much air pressure as at Kerbin's sea level. This is the measure used by :SEALEVELPRESSURE

pressure
A measure of the force the air pushes on a surface with. In SI units, it's Newtons per Square Meter. *This value is almost never used directly in any calculation. Instead you just calculate everything in terms of multiples of Atm's.*

density
A measure of how much mass of air there is in a volume of space. In SI units, it's Kilograms per Cubic Meter.

.. note::

**The following only applies to the STOCK KSP atmosphere.**

If you have installed a mod such as `FAR`_, that changes the atmosphere, then much of what is said below will not apply.

.. _FAR: http://forum.kerbalspaceprogram.com/threads/20451-0-25-Ferram-Aerospace-Research-v0-14-3-2-10-21-14

The level of atmosphere can be calculated for any altitude as follows:

- Number of **Atm's** = (Atm's at sea level) \* ( e ^ ( -
sea\_level\_alt / scale ) )

The **TRUE** maximum height of the atmosphere is NOT the value returned by :HEIGHT, but rather it's the altitude at which the number of Atm's returned by the above formula is 0.000001. :HEIGHT is just the value as advertised by the game to the user. On some worlds it can be quite a ways off.

And once you have that number, then density can be calculated from it with this conversion factor:

- air density = Number of Atm's \* 1.2230948554874.

Further information about the math formulas that Kerbal Space Program uses to calculate the atmosphere `can be found here <http://wiki.kerbalspaceprogram.com/wiki/Atmosphere>`__.

Examples::
**[Section deleted]**

IF SHIP:ORBIT:BODY:ATM:EXISTS {
SET thisAtmo TO SHIP:ORBIT:BODY:ATM.
PRINT "The planet you are orbiting has an atmosphere.".
PRINT "It's scale is " + thisAtmo:SCALE.
PRINT "It's height is " + thisAtmo:HEIGHT.
SET atmos TO thisAtmo:SEALEVELPRESSURE + ( CONSTANT():E ^ ( - SHIP:ALTITUDE / thisAtmo:SCALE ) ).
PRINT "At this altitude the atmosphere is " + atmos + " Atm's.".
} ELSE {
PRINT "The planet you are orbiting has no atmosphere.".
}.
This documentation used to contain a description of how the math for
Kerbal Space Program's default stock atmospheric model works, but
everything that was mentioned here became utterly false when KSP 1.0
was released with a brand new atmospheric model that invalided pretty
much everything that was said here. Rather than teach people incorrect
information, it was deemed that no documentation is better than misleading
documentation, so this section below this point has been removed.

67 changes: 0 additions & 67 deletions _sources/structures/misc/fileinfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ File name and size information. You can obtain a list of values of type FileInfo
* - :attr:`SIZE`
- integer (bytes)
- Size of the file
* - :attr:`MODIFIED`
- string
- The date the file was last modified
* - :attr:`CREATED`
- string
- The date the file was first created


.. attribute:: FileInfo:NAME
Expand Down Expand Up @@ -66,64 +60,3 @@ File name and size information. You can obtain a list of values of type FileInfo

size of the file, in bytes.

.. attribute:: FileInfo:MODIFIED

:access: Get only
:type: string

The date the file was last modified, in :ref:`Real World Timestamp <real world timestamp>` format, described below.

.. attribute:: FileInfo:CREATED

:access: Get only
:type: string

The date the file was first created, in :ref:`Real World Timestamp <real world timestamp>` format, described below.


.. _real world timestamp:

Real World Timestamp
--------------------

These timestamps are NOT in Kerbal Space Program's simulated clock, but are in real world time. This is for a good reason: the files exist outside of any one saved game and are global to all saved games you have. The format of the real-world timestamps is as follows::

YYYY-MM-DDThh:mm:ss.sssssZ

Where:

YYYY
The Four-digit year.
MM
The Two-digit month, padded with zeroes (i.e. September is '09' rather than '9'.)
DD
The Two-digit day of month, padded with zeroes (i.e. the 5th of the month is '05' rather than '5'.)
T
Always a hardcoded capital letter "T".
hh
The 24-hour clock time (5 AM is 05, 5 PM is 18).
mm
The Two-digit minute-hand, padded with zeroes.
ss.ssss
The seconds-hand, padded with zeroes to at least 2 digits before the decimal point, and a varying number of digits after that. It can store fractional parts of the second.
Z
Always a hardcoded capital letter "Z", meaning its the local timezone-less timestamp.

This string format should be possible to sort on directly. This example checks if a file exists on the current volume::

DECLARE PARAMETER searchFile.
LIST FILES IN fileList.
SET exists to FALSE.

FOR file IN fileList {
IF file:NAME = searchFile {
set exists to TRUE.
}
}

IF exists {
PRINT searchFile + " exists".
} ELSE {
PRINT searchFile + " does not exist".
}

4 changes: 2 additions & 2 deletions _sources/structures/misc/highlight.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ structure is defined as follows:
- bool
- controls the visibility of the highlight

Example:
Example::

list elements in elist.

Expand All @@ -49,4 +49,4 @@ Example:


// Turn the highlight back on
SET foo:ENABLED TO TRUE
SET foo:ENABLED TO TRUE
Loading

0 comments on commit bc996c9

Please sign in to comment.