Warum noch ein Einheiten-Konverter? Es gibt doch bereits jede Menge.
Tja, ich konnte aber keinen finden, der so funktionierte, wie ich es
mir vorstellte.
Mit ConvertAll kann man Einheiten auf beliebige Weise kombinieren.
Wenn Sie von Zoll pro Dekade konvertieren wollen, in Ordnung. Oder von
Meterpfund. Oder von nautischen Kubikmeilen. Die Einheiten müssen für
niemand anderen einen Sinn ergeben.
Da ich nichts mit dem Software-Business zu tun habe, erlaube ich
jedem, das Programm kostenlos zu nutzen, zu verteilen und zu
modifizieren, so lange es nicht Teil eines proprietären Programms wird.
Wenn Ihnen die Software gefällt, sagen Sie es ruhig weiter. Und teilen
Sie mir mit, was Sie denken. Meine E-Mail-Adresse ist doug101 AT bellz
DOT org.
Features
Die Basiseinheiten für die Konvertierung können
eingetippt (mit Auto-Vervollständigung) oder aus einer Liste
ausgewählt werden.
Einheiten können sowohl mit ihrer Abkürzung als auch mit ihrem
vollen Namen angegeben werden.
Einheiten können mit den Rechenoperationen „*“ und „/“ kombiniert
werden.
Mit dem Operator „^“ können Einheiten zu einer Potenz erhoben
werden.
Einheiten im Nenner können mit Klammern gruppiert werden.
Auch Einheiten mit nichtlinearen Skalen, wie Temperatur, können
konvertiert werden.
Eine Liste von Einheiten kann gefiltert und durchsucht werden.
Die zuletzt benutzten Einheitenkombinationen können in einem
Menü ausgewählt werden.
Zahlen können sowohl auf der Seite der Quell- als auch der
Zieleinheit angegeben werden, um in beide Richtungen konvertieren zu
können.
Anstelle von Zahlen können auch einfache mathematische Ausdrücke
eingegeben werden.
Die Formatierung der numerischen Ergebnisse kann durch Optionen
festgelegt werden.
Die Einheitendaten enthalten mehr als 500 Einheiten.
Das Format der Einheitendatei macht es einfach, neue Einheiten
hinzuzufügen.
Mit Hilfe von Kommandozeilenoptionen können Umwandlungen ohne die
GUI vorgenommen werden.
Rechtliches
ConvertAll ist freie Software. Sie können es unter den Bedingungen
der GNU General Public License, wie von der Free Software Foundation
veröffentlicht, weitergeben und/oder modifizieren, entweder gemäß
Version 2 der Lizenz oder (nach Ihrer Option) jeder späteren
Version.
Die Veröffentlichung dieses Programms erfolgt in der Hoffnung, daß
es Ihnen von Nutzen sein wird, aber OHNE IRGENDEINE GARANTIE. Details
finden Sie in der Datei LICENSE, die mit diesem Programm
ausgeliefert wird.
Systemanforderungen
Linux
ConvertAll benötigt die folgenden Bibliotheken:
Python (Version 3.2 oder höher)
Qt (Version 4.6 oder höher -
siehe Trolltech für weitere
Informationen)
PyQt (Version 4.8 oder höher - siehe Riverbank
für weitere Informationen)
Diese Libraries sind relativ neu - evtl. gibt es kein Paket für Ihre
Distribution. In diesem Fall gibt es noch eine frühere Version von
ConvertAll (0.3.2), die von älteren Versionen der Libraries abhängt.
Diese steht aber leider nur in Englisch zur Verfügung.
Windows
Wenn Sie die Dateien aus dem Binärpaket nutzen, sollte ConvertAll
auf jedem Computer mit Windows XP, Vista, 7 oder 8 laufen.
Installation
Linux
Packen Sie die Quelldateien aus dem convertall tar-Archiv aus, wechseln
Sie dann in einem Terminal in das Verzeichnis ConvertAll. Für
eine einfache Installation führen Sie nur den folgenden Befehl als
„root“ aus: python install.py
Um alle Installationsoptionen zu sehen, geben Sie ein: python
install.py -h
Um ConvertAll unter einem anderen Verzeichnispräfix zu installieren
(der Default ist /usr/local), geben Sie dies ein:
python install.py -p /prefix/pfad
Windows
Führen Sie einfach die heruntergeladene Installationsdatei aus
(convertall-x.x.x-install-all.exe). Damit wird das Programm mit
den Libraries installiert und optional werden Dateitypzuordnungen und
Verweise angelegt.
Wenn Sie den Quellcode modifizieren wollen oder eigene
PyQt-Programme für Windows schreiben wollen, dann folgen Sie nicht den
gerade beschrieben Ablauf. Stattdessen müssen Sie
Python und das Binary von
PyQt installieren.
Dann entpacken Sie den Sourcecode und die Daten-Dateien der Linux-Version
(die convertall tar-Datei) in ein Verzeichnis Ihrer Wahl und führen die
Datei convertall.py aus.
ConvertAll benutzen
Grundlagen
Geben Sie einfach einen Einheitennamen in das Eingabefeld
„Ausgangseinheit“ ein. Während Sie tippen, verschiebt sich die Liste unter
dem Eingabefeld, bis Einheitennamen angezeigt werden, die Ihrer Eingabe
ähnlich sind. Geben Sie entweder das Einheitenkürzel bzw. den
Einheitennamen komplett an oder drücken Sie die Eingabetaste, um die in
der Liste hervorgehobene Einheit zu nehmen. Natürlich können Sie auch
mit der Maus auf eine Einheit aus der Liste klicken, um sie in das
Eingabefeld zu übernehmen. Sie können auch die Pfeiltasten nach oben und
unten benutzen, um benachbarte Einheiten aus der Liste auszuwählen.
Wiederholen Sie die Einheiteneingabe im Eingabefeld „Zieleinheit”.
Wenn Sie fertig und die Einheiten kompatibel sind, dann sehen Sie, dass
die numerischen Eingabefelder unterhalb der Einheitenlisten aktiviert
werden. Sie können in eines der beiden Felder einen Zahlenwert
eingeben, und im anderen Feld wird das Ergebnis der Umwandlung stehen.
Einheiten kombinieren
Die wahre Stärke von ConvertAll liegt in seiner Fähigkeit, mehrere
Einheiten zu kombinieren. Geben Sie einfach die Einheitennamen mit
einem ‚*‘ oder ‚/‘ dazwischen ein. Damit können Sie Einheiten wie „N*m”
oder „km/hr“ ausdrücken. Das Symbol ‚^‘ kann für Exponenten genutzt
werden, wie „m^3“ oder „kg*m/s^2”. Negative Exponenten sind erlaubt, um
Einheiten wie „sec^-1“ (pro Sekunde) angeben zu können, aber es kann
sein, dass sich dadurch Multiplikations- oder Divisionszeichen
umkehren („m*s^-2“ wird zu „m/s^2”).
Multiplikation und Division haben die gleiche Präzedenz und werden
daher von links nach rechts ausgewertet. Es können auch Klammern benutzt werden,
um die Einheiten im Nenner zu gruppieren. Daher kann „m / sec / hr“ auch als „m
/ (sec * hr)“ eingegeben werden. Die Variante mit den Klammern ist
möglicherweise weniger verwirrend.
Die Schaltflächen unter den Einheitenlisten („X“, „/“, „^2“, „^3“)
fügen ebenfalls den jeweiligen Operator hinter der Einheit ein, die der
Schreibmarke am nächsten steht. Die Schaltflächen für die
Exponenten ersetzen den Exponenten der Einheit.
Auch wenn Sie auf eine Einheit aus der Liste klicken, wird im
Allgemeinen die der Schreibmarke am nächsten stehende Einheit
im Eingabefeld ersetzt.
Die Schaltfläche „Einheit löschen“ unter den
Operator-Schaltflächen kann benutzt werden, um das Eingabefeld zu
löschen und eine neue Einheit eingeben zu können.
Abkürzungen
Wenn Sie Einheitennamen eingeben, werden Leerzeichen ignoriert. Sie
können sie also weglassen. Wenn Sie einen Teil eines Einheitennamens
bereits eingetippt haben, wird der entsprechende Eintrag in der Liste
hervorgehoben. Durch Drücken der Eingabetaste wird der Name
im Eingabefeld vervollständigt. Auch durch Betätigen der Tabulatortaste
wird der Name vervollständigt und zum nächsten Eingabefeld
gesprungen.
Die Schaltfläche „Zuletzt benutzte Einheit“ öffnet ein Menü
der zuletzt verwendeten Einheiten und Einheitenkombinationen. Die aktuelle
Einheitenkombination wird durch eine Auswahl in diesem Menü ersetzt.
Der zu konvertierende Zahlenwert kann entweder auf der „Ausgangs”-
oder der „Ziel”-Seite eingegeben werden. Für die Eingabe kann Standard- oder
wissenschaftliche Schreibweise benutzt werden, oder ein Ausdruck mit
einfachen mathematischen Operatoren (+, -, *, /, **) und Klammern.
Einheitensuche
Die Einheitensuche kann benutzt werden, um Einheiten nach Typ zu
filtern und/oder mit einem Textstring nach Einheiten zu suchen. Sie
zeigt in einem neuen Fenster eine separate Einheitenliste. Die Liste
wird anhand des Filters und der Sucheingabe aktualisiert.
Mit Schaltflächen weiter unten im Suchfenster kann die ausgewählte
Einheit zu den Einheiten in einem Eingabefeld im Hauptfenster
hinzugefügt werden. Die „Ersetzen”-Schaltflächen ersetzen die gesamte
Eingabe durch die ausgewählte Einheit. Die „Einfügen”-Schaltflächen
ändern nur den Teil einer kombinierten Einheit, der aktiv ist (bei der
Schreibmarke im jeweiligen Eingabefeld des Hauptfensters).
Optionen
Die Schaltfläche „Optionen...“ öffnet ein Fenster, in dem sich
verschiedene Voreinstellungen ändern lassen. Diese werden automatisch
gespeichert, ConvertAll startet das nächste Mal automatisch mit den
zuletzt gewählten Einstellungen.
Die erste Option bestimmt die Anzeige numerischer Ergebnisse,
einschließlich der Verwendung einer wissenschaftlichen Zahlennotation
und der Anzahl der dargestellten Dezimalstellen. Setzen Sie die Zahl der
Dezimalstellen nicht zu niedrig, da hierdurch die Genauigkeit stark
leiden kann. Sechs oder mehr Stellen sind empfohlen (acht ist die
Voreinstellung).
Es gibt eine Option, um festzulegen, wie viele der zuletzt benutzten
Einheiten gespeichert werden sollen. Setzt man die Zahl auf Null, dann werden die
Schaltflächen für den Zugriff auf die zuletzt benutzten Einheiten
deaktiviert.
Ein Option dient dazu, die Schaltflächen mit den Operationen („X“, „/“,
„^2“, „^3“, „Einheit löschen“ und „Zuletzt verwendete Einheit“) zu verstecken.
Durch diese Option kann man Platz sparen, falls Sie die Operatoren nur mit der
Tastatur eingeben.
Weitere Schaltflächen im Optionsdialog dienen dazu, die Farben der
Textfelder zu ändern.
Nichtlineare Umwandlungen
Bei einigen Einheiten ist die Umwandlung nichtlinear. Dazu gehören
zum Beispiel die Temperaturenskalen für Fahrenheit und Celsius (da der
Nullpunkt einen Offset hat) und für American Wire Gauge (amer.
Kodierung für Drahtdurchmesser, logarithmische Skala). Die
nichtlinearen Einheiten sind in der Kommentarspalte (rechts von der
Typ-Spalte) als solche gekennzeichnet.
Diese Einheiten können nur umgewandelt werden, wenn sie nicht mit
anderen Einheiten kombiniert werden und keinen Exponenten tragen.
Andernfalls wäre die Umwandlung nicht sinnvoll.
Verwendung auf der Kommandozeile
Umwandlungen können auf der Kommandozeile (Linux-Konsole oder
Windows/DOS Befehlsaufforderung) ausgeführt werden, ohne die grafische
Benutzerschnittstelle aufzurufen. Geben Sie den Befehl („convertall“ unter Linux,
„convertall_dos“ aus dem Windows-Binäarpaket),
gefolgt von der Zahl, der Ausgangseinheit und der Quelleinheit an,
getrennt durch Leerzeichen. Wenn Einheitennamen Leerzeichen enthalten,
müssen sie in Anführungszeichen gesetzt werden. Alternativ können Sie
auch die Option „-i“ auf der Kommandozeile verwenden („convertall -i“ unter Linux,
„convertall_dos -i“ unter Windows), die Angaben werden
dann interaktiv eingegeben.
Wenn die Umwandlung erfolgt ist, fragt ConvertAll nach einer neuen
Zahl für die gleiche Umwandlung. Mit „n“ wird eine neue Umwandlung
gestartet, mit „r“ kann die Konversion umgekehrt werden, mit „q“ wird das
Programm beendet.
Mit der Option „-h“ auf der Kommandozeile („convertall -h“ unter Linux,
„convertall_dos -h“ unter Windows) bekommen Sie eine ausführlichere Liste
der Optionen.
Versionshistorie
Die vollständige Versionshistorie befindet sich in der englischen
Version der README-Datei.
Fragen, Kommentare, Kritik?
Man kann mich per E-Mail erreichen unter: doug101 AT bellz DOT
org Ich freue mich über jedes Feedback, einschließlich Mitteilung
über Fehler, die Sie finden. Schauen Sie auch regelmäßig unter
www.bellz.org nach Updates.
¿Porqué otro convertidor de unidades? Existen muchos por allí.
Bien, no he podido encontrar uno que funcionara en la forma que
yo quería.
Con ConvertAll, usted puede combinar las unidades en la forma
que quiera. Si usted quiere convertir desde pulgadas por década,
está bien. O desde metro-libra. O desde millas náuticas al cubo.
Las unidades no tienen porqué tener sentido para los demás.
Dado que no estoy en el negocio del software, distribuyo este
programa libremente para que cualquiera lo utilice, lo distribuya
o lo modifique, siempre y cuando no sea incorporado en ningún
programa propietario. Si le gusta este programa siéntase en
libertad de darlo a conocer a otros. Y hágame saber qué es lo que
piensa - mi dirección de e-mail es doug101 AT bellz DOT org
Características
Las unidades básicas para la conversión pueden ser escritas
(con completado automático) o seleccionadas desde una lista.
Las unidades pueden ser elegidas ya sea por una abreviación
o por su nombre completo.
Las unidades pueden combinarse con las operaciones "*" y "/".
Las unidades pueden elevarse a una potencia con el operador "^".
Las unidades en el denominador pueden agruparse con paréntesis.
Las unidades con escalas no lineales, como la temperatura,
pueden también ser convertidas.
Una lista de unidades puede ser filtrada y se pueden realizar
búsquedas en ella.
Combinaciones de unidades ya utilizadas pueden ser seleccionadas
desde un menú.
Los números pueden introducirse ya sea en las entradas "Desde"
o "Hacia" para conversiones en ambas direcciones.
Expresiones matemáticas básicas pueden ser introducidas en
lugar de números.
Existen opciones para controlar el formato de los resultados
numéricos.
El archivo de datos cuenta con más de 500 unidades.
El formato del archivo de datos permite agregar
unidades muy fácilmente.
Opciones para la línea de comandos están disponibles
para realizar conversiones sin interfaz gráfica.
Cuestiones legales
ConvertAll es software libre; puede usted distribuirlo
y/o modificarlo bajo los términos de la licencia pública
general GNU como ha sido publicada por la Free Software
Foundation; ya sea la versión 2 de la licencia o (a su
opción) cualquier versión posterior.
Este programa es distribuido con la esperanza de que
resulte de utilidad, pero SIN NINGUNA GARANTÍA. Mire el
archivo de LICENCIA distribuido con este programa para
mayor información.
Requerimientos del sistema
Linux
ConvertAll requiere las siguientes librerías:
Python (Versión 3.2 o superior)
Qt (Versión 4.6 o superior - ver Trolltech para más
información)
PyQt (Versión 4.8 o superior - ver Riverbank
para más información)
Windows
Utilizando los archivos provistos en la distribución binaria, ConvertAll
debería correr en cualquier computador utilizando Windows
XP, Vista, 7 o 8.
Instalación
Linux
Extraiga los archivos fuente del archivo tar de convertall, cambie al
directorio ConvertAll en la terminal. Para una instalación
básica, simplemente ejecute el siguiente comando como administrador:
python install.py
Para ver todas las opciones de instalación,
utilice: python install.py -h
Para instalar ConvertAll con un prefijo diferente (el valor por defecto
es /usr/local), utilice: python install.py -p
/prefix/path
Windows
Simplemente ejecute el archivo de instalación descargado
(convertall-x.x.x-install-all.exe). Esto instalará el programa
con sus librerías y opcionalmente creará las asociaciones de archivos y
los accesos directos.
Si usted desea modificar el código fuente o escribir sus propios
programas PyQt para Windows, no utilice el procedimiento anterior. En
cambio, usted necesita instalar Python
y los binarios para PyQt. Extraiga entonces
el código fuente y los archivos de datos desde la versión para Linux
(el archivo tar para convertall) a un directorio de su elección y ejecute
el archivo convertall.py.
Utilizando ConvertAll
Bases
Simplemente escriba el nombre de una unidad en la ventana de edición
"Desde unidad" (From Unit). Mientras escribe, la lista debajo se moverá para
mostrar el nombre de la unidad más cercano. Puede o bien escribir el
nombre completo de la unidad o su abreviación o presionar Enter para
utilizar la unidad seleccionada en la lista. Por supuesto, clickando
con el ratón en una unidad de la lista también agregará la unidad a la
ventana de edición. También es posible utilizar las teclas "arriba"
y "abajo" para seleccionar una unidad de la lista.
Repita el procedimiento para seleccionar unidades en la ventana de
edición "A unidad" (To Unit). Cuando esté listo, si las unidades son compatibles
verá que se activa la ventana de edición numérica debajo de la lista
de unidades. Un número puede ser escrito en cualquiera de las ventanas
numéricas y la otra mostrará el resultado de la conversión.
Combinando unidades
La verdadera fuerza de ConvertAll descansa en su habilidad para
combinar múltiples unidades. Simplemente escriba los nombres de las
unidades con '*' o '/' entre ellas. Esto permite entradas como
"m*kg" o "km/hr". El símbolo '^' puede utilizarse para exponentes,
como "cm^3" o "cm*gr/seg^2". Exponentes negativos pueden utilizarse
para unidades como "seg^-1" (por segundo), pero puede cambiar entre
los símbolos de multiplicación y división ("cm*seg^-2" se convierte
en "cm/seg^2").
Multiplicación y división tienen la misma precedencia, por lo que
son evaluadas de izquierda a derecha. Es posible utilizar paréntesis
para agrupar unidades en el denominador. De esta forma
"m / seg / kg" puede ser también escrito como "m / (seg * kg)".
La versión entre paréntesis es probablemente menos confusa.
Los botones debajo de las listas de unidades ('X', '/', '^2', '^3')
insertarán también los correspondientes operadores después de la unidad más
cercana al cursor. Los botones con exponentes reemplazarán los
exponentes de la unidad.
En modo semejante, haciendo click en una unidad de la lista generalmente
reemplaza la unidad más cercana al cursor.
El botón de "Limpiar unidades" (Clear Unit) debajo de los botones con los operadores
puede ser utilizado para vaciar la ventana de edición de unidades y así
permitir que nuevas unidades sean escritas.
Atajos de teclado
Cuando se escriben unidades, los espacios son ignorados por lo que
pueden evitarse. También será generalmente ignorado si la forma
plural del nombre de la unidad es introducida. Cuando una unidad
escrita parcialmente es seleccionada de la lista, presionar Enter
completará el nombre. Además, presionar la tecla tab completará el
nombre y moverá el cursor al siguiente campo de entrada.
El botón "Unidades recientes" (Recent Unit) abre un menú con las unidades y
combinaciones de unidades recientemente utilizadas. La combinación de
unidades actual será reemplazada con cualquier selección de ese menú.
El número a ser convertido puede ser ingresado ya sea en "Desde" o
en "a". Notación científica estándar puede utilizarse, o una expresión
incluyendo los operadores matemáticos normales (+, -, *, /, **) y paréntesis
puede ser escrita.
Buscador de unidades
El buscador de unidades (Unit Finder) puede utilizarse para filtrar unidades por
tipo y/o buscar unidades utilizando una cadena de texto. El buscador
mostrará una lista de unidades separada en una nueva ventana. La lista
será actualizada según el filtro y la cadena de búsqueda utilizados.
Los botones cerca de la parte baja de la ventana del buscador agregarán
la unidad elegida a las unidades de la ventana principal. El botón
"Reemplazar" (Replace) reemplazará toda la combinación de unidades con la selección.
El botón "Insertar" (Insert) cambia solo la parte de la unidad combinada que está
activa (a la posición del cursor en la ventana principal).
Opciones
El botón "Opciones..." (Options) permite cambiar varios valores por defecto
de la configuración. Estos valores son automáticamente almacenados y
por lo tanto ConvertAll iniciará con los valores utilizados por última vez.
La primer opción controla la forma en que se muestran los resultados numéricos,
incluyendo el uso de notación científica y el número de decimales a utilizar.
Tenga cuidado con seleccionar el número de decimales muy bajo ya que podría
significar una importante pérdida de precisión. Seis o más dígitos es
recomendable (ocho es el valor por defecto).
Sigue la opción para configurar el número de unidades recientemente utilizadas a
ser salvadas. Configurando este valor en cero deshabilita el botón "Unidades recientes".
A continuación se tiene la opción de ocultar los botones con los operadores (x, /,
^2, ^3, Clear Unit and Recent Unit). Esto puede utilizarse para salvar espacio
en el caso que el teclado sea utilizado para entrar los operadores.
La última opción controla los colores de los campos de texto.
Conversiones no-lineares
La conversión de algunas unidades es no linear. Ejemplos de esto
incluyen las escalas de temperatura Fahrenheit y Celsius (debido a los diferentes
puntos para el cero) y el "American Wire Gauge" que es logarítmica. Las
unidades no lineares están etiquetadas como tales en la columna comentarios (Comments)
situada a la derecha de la columna "Tipo" (Type).
Estas unidades pueden ser convertidas solo cuando no están combinadas con
otras unidades o utilizadas con un exponente. De otro modo la conversión no
tendrá significado.
Uso desde la línea de comandos
Conversiones pueden ser efectuadas desde la línea de comandos (consola Linux o DOS)
sin invocar la interfaz gráfica. Es suficiente entrar el comando
("convertall" en Linux, "convertall_dos" con el binario para Windows), el
número, la unidad desde la que se quiere convertir y la unidad a la que se
quiere llegar (separada por espacios) para realizar la conversión.
Los nombres de las unidades que contengan espacios deberán ser rodeados de comillas.
O, para que el programa pregunte por cada unidad, utilizar la opción "-i"
("convertall -i" en Linux, "convertall_dos -i" en Windows).
Después de la conversión, ConvertAll preguntará por un nuevo número
para realizar la misma conversión. Puede utilizarse "n" para iniciar una nueva
conversión, "r" para invertir la conversión o "q" para salir del programa.
Para una lista detallada de las opciones, utilice la opción "-h" ("convertall
-h" en Linux, "convertall_dos -h" en Windows).
Historia
La revisión histórica completa puede ser encontrada en la versión inglesa
de este archivo.
¿Preguntas, comentarios, críticas?
Puedo ser contactado por email a: doug101 AT bellz DOT org
Agradezco cualquier feedback, incluyendo reporte de cualquier error
que usted encuentre. Además, puede usted también consultar periódicamente
el sitio www.bellz.org por cualquier
actualización.
Why write another unit converter? There are plenty of them out
there. Well, I couldn't find one that worked quite the way I
wanted.
With ConvertAll, you can combine the units any way you want. If
you want to convert from inches per decade, that's fine. Or from
meter-pounds. Or from cubic nautical miles. The units don't have to
make sense to anyone else.
Since I'm not in the software business, I'm making this program
free for anyone to use, distribute and modify, as long as it is not
incorporated into any proprietary programs. If you like the software,
feel free to let others know about it. And let me know what you think
- my email address is doug101 AT bellz DOT org
Features
The base units for conversion may be either typed (with
auto-completion) or selected from a list.
Units may be selected using either an abbreviation or a full
name.
Units may be combined with the "*" and "/" operators.
Units may be raised to powers with the "^" operator.
Units in the denominator may be grouped with parenthesis.
Units with non-linear scales, such as temperature, can also be
converted.
A unit list may be filtered and searched.
Recently used unit combinations may be picked from a menu.
Numbers may be entered on either the "From" or the "To" units
side, for conversions in both directions.
Basic mathematical expressions may be entered in place of
numbers.
Options control the formatting of numerical results.
The unit data includes over 500 units.
The format of the unit data file makes it easy to add additional
units.
Command line options are available to do conversions without the
GUI.
The user interface and the unit data are available in English,
French, German and Spanish.
Legal Issues
ConvertAll is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either Version 2 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY. See the LICENSE file provided with
this program for more information.
System Requirements
Linux
ConvertAll requires the following libraries:
Python (Version 3.2 or higher)
Qt (Version 4.6, 4.7 or 4.8 - see Qt Project for more
information)
PyQt (Version 4.8.x, 4.9.x or 4.10.x - see Riverbank
for more information)
If these libraries are not be available for your distribution, an
earlier version of ConvertAll (0.5.2) that depends on older libraries is
still available.
Windows
Using the files provided in the binary distribution, ConvertAll
should run on any computer running Windows XP, Vista, 7 or 8.
Installation
Linux
Extract the source files from the convertall tar file, then change to
the ConvertAll directory in a terminal. For a basic
installation, simply execute the following command as root: python
install.py
If your distribution defaults to Python 2.x, you may need to
substitute python3, python3.2 or python3.3
for python in these commands.
To see all install options, use: python install.py -h. To
install ConvertAll with a different prefix (the default is
/usr/local), use: python install.py -p
/prefix/path
Windows
To install for all users, execute the
ConvertAll-x.x.x-install-all.exe file. Administrator
permissions are required.
To install for a single user (administrator rights are not required),
execute the ConvertAll-x.x.x-install-user.exe file.
For a portable install, execute the
ConvertAll-x.x.x-install-user.exe file, uncheck the shortcuts
and uninstaller tasks, and check the portable config task.
Using ConvertAll
Basics
Simply type a unit name in the "From Unit" edit window. As you
type, the list below the window will scroll to show unit names which
are close matches. Either type the complete unit abbreviation or unit
name or hit the return key to use the unit highlighted in the list.
Of course, clicking with the mouse on a unit in the list will also add
the unit to the edit window. You may also use the up and down arrow
keys to select nearby units from the list.
Repeat the unit selection in the "To Unit" edit window. When done,
if the units are compatible, you will see the numeric edit windows
below the unit lists activate. A number may be entered into either
numeric window and the other window will display the conversion
result.
Combining Units
The real strength of ConvertAll lies in its ability to combine
multiple units. Simply type the unit names with an '*' or a '/'
between them. This allows the entry of units such as "ft*lbf" or
"mi/hr". The '^' symbol may be used for exponents, such as "ft^3" or
"ft*lbm/sec^2". Negative exponents are allowed for units such as
"sec^-1" (per second), but may switch the multiplication or division
symbol ("ft*sec^-2" becomes "ft/sec^2").
Multiplication and division have the same precedence, so they are
evaluated left-to-right. Parenthesis may also be used to group units in
the denominator. So "m / sec / kg" can also be entered as "m / (sec *
kg)". The version with parenthesis is probably less confusing.
The buttons below the unit lists ('X', '/', '^2', '^3') will also
place the operators after the unit nearest to the cursor. The
exponent keys will replace the unit's exponent.
Similarly, clicking on a unit from the list generally replaces the
unit nearest the cursor.
The "Clear Unit" button below the operator buttons may be used to
empty the unit edit window to allow a new unit to be entered.
Shortcuts
When typing unit names, spaces are ignored, so they may be skipped.
It is also generally ignored if a plural form of the unit name is
typed. When a partially typed unit is highlighted in the list,
hitting enter will complete the name. Also, hitting the tab key will
complete the name and move to the next entry field.
The "Recent Unit" button opens a menu of recently used units and
unit combinations. The current unit combination is replaced with any
selections from this menu.
The number to be converted may be entered in either the "From" or
"To" unit side. Standard or scientific notation may be used, or an
expression including the normal math operators (+, -, *, /, **) and
parenthesis may be entered.
Unit Finder
The unit finder can be used to filter units by type and/or search for
units using a text string. It displays a separate unit list in a new
window. The list will be updated based on the filter and search string
entries.
Buttons near the bottom of the finder window add the selected unit to
the units in the main window. The "Replace" buttons replace an entire
combined unit with the selection. The "Insert" button changes only the
part of a combined unit that is active (at the cursor in the main
window).
Options
The "Options..." button allows for changing several default
settings. These settings are automatically stored so that ConvertAll
will re-start with the settings last used.
The first options control the display of numerical results,
including the use of scientific notation and the number of decimal
places. Be cautious about setting the number of decimal places to a
low value, which can result in a significant loss of accuracy. Six
places or higher is recommended (eight is the default).
There is an option to set the number of recent units to be saved.
Setting it to zero will disable the Recent Unit buttons. Another option
will automatically load the most recent previous units at startup.
There is an option to hide the operator text option buttons (x, /,
^2, ^3, Clear Unit and Recent Unit). These can be hidden to save space
if the keyboard will be used to enter the operators.
Buttons are also included on the options dialog to control the colors
of the text fields.
Non-Linear Conversions
The conversion of some units is non-linear. Examples of these
include the Fahrenheit and Celsius temperature scales (due to an
offset zero point) and the American Wire Gauge (logarithmic). The
non-linear units are labeled as such in the comments column (located
to the right of the "Type" column).
These units can be converted only when they are not combined with
other units or used with an exponential operator. Otherwise the
conversion would not be meaningful.
Command Line Usage
Conversions may be done from the command line (Linux or DOS console)
without invoking the graphical interface. Enter the command
("convertall" on Linux, "convertall_dos" from the Windows binary), the
number, the from unit and the to unit (separated by spaces) to do the
conversion. Unit names containing spaces should be surrounded by
quotes. Or, to be prompted for each unit entry, use the "-i" option
("convertall -i" on Linux, "convertall_dos -i" from Windows).
After the conversion is done, ConvertAll will prompt for a new number
to do the same conversion. Or "n" can be entered to start a new
conversion, "r" to reverse the conversion or "q" to quit.
For a more detailed list of options, use the "-h" option ("convertall
-h" on Linux, "convertall_dos -h" on Windows).
Revision History
February 1, 2014 - Release 0.6.0
New Features:
ConvertAll has been ported from Python 2 to Python 3. This
porting includes some code cleanup.
Added an option to automatically load the last used units at
startup.
Added an introductory tip dialog box that explains combined units.
There is also an option to hide this dialog.
There is an additional Windows installer for users without
administrator rights and for portable installations.
Added a Windows installer option to add a config file to the
program's directory for portable installations. If that file is
present, no config files will be written to users' directories.
Updates:
The Windows binaries are built using more recent Python, Qt and
PyQt libraries.
The user interface and unit data language translations are now
included in the main installation files.
Added the long ton unit (Imperial version of the ton).
Added the kilopond unit as a synonym of kilogram-force.
Added the micron of Hg pressure unit.
Added the lunar distance (LD) astronomical distance unit.
Added the rack unit (height of an electrical rack).
Added the versta Russian length unit.
Bug Fixes:
Fixed the operation of the "Clear" button in the Unit Finder
dialog.
Fixed a problem with the definition of the BTU unit in the French
translation.
November 2, 2011 - Release 0.5.2
Updates:
Added the microliter volume unit.
Added the galileo acceleration unit.
Added the stremma land area unit.
Bug Fixes:
Changed the method of identifying a "unitless" portion of a unit
to avoid falsely reporting incompatibility between some units when
using language translations.
March 31, 2011 - Release 0.5.1
Updates:
Added the link length unit.
Added US survey variations of the mile and chain length
units.
Added the centigray radiation dose unit.
Use DOS newline characters in the Windows version of the unit data
file for easier editing by users.
Bug Fixes:
Fixed incorrect definition of the rad radiation dose unit (it was
off by a factor of 10).
May 2, 2010 - Translation Update 0.5.0b
Updates:
Added a Spanish translation. The French and German translations
remain unchanged.
April 23, 2010 - Release 0.5.0
New Features:
Multiplication and division operators now have the same
precedence. In previous versions of ConvertAll, a series of units
after a division symbol were assumed to be in the denominator. Now, a
division operator only affects the unit (or the unit group in
parenthesis) immediately after the operator.
Parenthesis are now supported to group units in the denominator of
a combined unit. For example, ""m / sec / kg" can also be entered as
"m / (sec * kg)".
"Recent Unit" buttons have been added that open a menu of recently
used units and unit combinations. A unit selected from the menu will
replace the current unit combination. There is also a new option
dialog entry that controls the maximum length of this menu.
Updates:
Added the tonne force metric force unit.
Added hundredweight long and hundredweight short mass units.
Added an American Wire Gauge (AWG) area unit in addition to the
existing AWG diameter unit.
Added the tonne oil equivalent and the tonne coal equivalent
energy units.
Added the ton refrigeration power unit.
Added the darcy and millidarcy permeability units.
French and German translations have been added for the user
interface and the unit data. To use them, download and install the
"convertall-i18n..." file for your platform (in addition to installing
the standard ConvertAll package).
Bug Fixes:
Fixed problems with running in the command line mode from Linux
consoles without X11 present.
September 24, 2009 - Release 0.4.3
New Features:
Prepared ConvertAll for translation efforts by properly handling
Unicode characters in unit data and by marking internal program
strings for translation. Volunteers for translating ConvertAll into
other languages are welcome.
Updates:
Added solar mass and pennyweight mass units.
Added therm and thermie energy units.
Added gauss and maxwell magnetic units.
Added the US survey foot length unit.
Added the mpg imp mileage unit.
Changed the value of the point unit from the old American point to
the more modern desktop publishing point.
Bug Fixes:
A critical QString conversion bug that caused ConvertAll to not
run with the latest version of PyQt (4.5.4) was fixed.
Command line quiet mode was fixed to avoid an interactive prompt
when bad unit data is entered.
May 28, 2008 - Release 0.4.2
Updates:
Added the "liter per 100 km" unit for fuel consumption.
Bug Fixes:
Changed the "mach" unit from 331.46 m/s to 340.29 m/s. It is now
correct for STP conditions (15 degrees C). The previous value was for
0 degrees C.
Fixed a bug that could hide messages about errors in a manually
edited unit data file.
January 22, 2008 - Release 0.4.1
New Features:
An optional command line mode was added to do conversions without
the graphical interface. Enter the command ("convertall"), the
number, the from unit and the to unit (separated by spaces) to do the
conversion. For a more detailed list of options, enter "convertall
-h" on the command line.
Updates:
The icon used for ConvertAll has been updated. Thanks to Ricardo
Berlasso for the new artwork.
Alternate units have been added for kilobyte, megabyte, etc.,
marked "IEC std". These convert using powers of 10, rather than
powers of 2.
Troy pounds and troy ounces have been added.
Gigapascal, hectopascal and megabar have been added.
Hogshead units for wine and beer have been added.
The Swedish mil unit of distance has been added.
The Thai rai and ngaan units of land area have been added.
October 5, 2006 - Release 0.4.0
New Features:
ConvertAll was ported to the Qt4 library. This involved a
significant rewrite of the code. The previous versions used Qt3.x on
Linux and Qt2.3 on Windows. Benefits include updated widgets and
removal of the non-commercial license exception in Windows.
Updates:
On Windows, the ConvertAll.ini file has been moved from the
installation directory to a location under the "Documents and
Settings" folder. This avoids problems on multi-user systems and for
users with limited access rights.
October 5, 2006 - Release 0.3.2
Updates:
Added Imperial (UK) gallons, quarts, pints and fluid ounces.
Added gigagram and teragram units.
Added the pound-mole unit and clarified that the existing mole is
a gram-mole.
February 14, 2005 - Release 0.3.1
Updates:
Added the decare unit for land area.
The Linux installer has been updated to be more robust and give
more install directory options.
Bug Fixes:
The barn unit, used in particle physics, was corrected. It had
been incorrectly listed as a length unit instead of an area unit.
March 11, 2004 - Release 0.3.0
New Features:
A unit finder window was added to allow the unit list to be
filtered and searched.
The size and position of the main and finder windows are now saved
at exit.
A new option allows the operator text entry buttons (x, /, ^2, ^3
and Clear Unit) to be hidden.
An install program has been added for windows.
Bug Fixes:
Fixed Linux install script problems with certain versions of
Python.
November 18, 2003 - Release 0.2.4
Updates:
Keyboard shortcuts and tab-focus order for the main dialog have
been improved.
An install script was added for Linux and Unix systems.
The windows build now uses Python version 2.3 and PyQt version
3.8.
March 24, 2003 - Release 0.2.3
Updates:
When an expression using division is entered for the number to be
converted, floating point division is now used even if the entries are
integers (Python 2.2 or greater only).
Mouse wheels are now supported in the unit lists.
Icon files are now provided with the distribution files.
May 28, 2002 - Release 0.2.2a
Bug Fixes:
A fix of the Windows binary only. Fixes major problems by
upgrading the library version to PyQt 3.2.4.
May 16, 2002 - Release 0.2.2
Updates:
ConvertAll has been ported to Qt 3.x. It now works with both Qt
2.x and 3.x using the same source code.
The help/readme file has been rewritten and now includes section
links.
The binaries for windows have been updated to Python 2.2 and PyQt
3.2 (but are still using Qt 2.3 Non-commercial).
September 17, 2001 - Release 0.2.1
Bug Fixes:
Some window captions and icons were corrected.
A window maximizing bug was fixed.
August 20, 2001 - Release 0.2.0
New Features:
A major rewrite was done of the conversion engine.
A new data file format makes it easier to add and verify
units.
The unit name and abbreviation are now listed separately for
better sorting and searching.
Entering of units has been improved by changing operator
precedence, by ignoring spaces and plurals, and by changing the
partial selection list highlight.
An expression can now be used for the number to be
converted.
Updates:
Many additional units were added to the database.
For MS Windows users, the binary files were upgraded to PyQt
Version 2.5.
August 10, 2001 - Release 0.1.1
New Features:
Added color controls to the options dialog.
Updates:
The convertall.ini file on windows was moved to the program
directory.
Bug Fixes:
Fixed problems with using the same unit twice in a combined
unit.
Fixed an occasional shutdown when auto-completing.
Fixed a problem with the updating of the unit label.
July 28, 2001 - Release 0.1.0
Initial release.
Questions, Comments, Criticisms?
I can be contacted by email at: doug101 AT bellz DOT org I
welcome any feedback, including reports of any bugs you find. Also, you
can periodically check back to www.bellz.org for any updates.
Pourquoi écrire un autre convertisseur d'unités? Eh bien, je n'en avais trouvé aucun qui était comme je le voulais.
Avec ConvertAll, vous pouvez combiner les unités comme vous le voulez. Si vous voulez convertir des pouces en kilomètre, ca fonctionne! Les unités n'ont pas à avoir de sens pour personne d'autres que vous.
Comme je ne suis pas dans l'industrie du logiciel, je fais ce programme librement, je le distribue librement et j'autorise n'importe qui à le copier ou le modifier tant qu'il ne se retrouve pas dans un logiciel propriétaire. Si vous aimez ce logiciel, sentez-vous libre d'en parler. Aussi, donnez-moi des commentaires par courriel - mon adresse est doug101 AT bellz.org
Capacités
L'unité à convertir peut être écrite (avec auto complétion) ou choisie dans une liste.
Vous pouvez utiliser les abréviations ou les unités au long.
Les unités peuvent être combinées avec les opérateurs "*" et "/".
Le symbole "^" peut être utilisé pour les exposants.
Les unités non linaires (comme la température) peuvent être converties.
Une liste d'unité peut être filtrée et cherchée
Les nombres peuvent être écrits et convertis dans les deux directions.
Des expressions mathématiques de bases peuvent être écrites à la place de nombres.
Le menu Options contrôle le formatage des résultats numériques.
Vous trouverez au-delà de 500 unités.
Le format du fichier de données est facilement modifiable pour ajouter de nouvelles unités.
La version en lignes de commandes peut être utilisée.
Dispositions légales
ConvertAll est un logiciel libre; vous pouvez le redistribuer et/ou le modifier sous les termes de la licence GNU GPL (GNU General Public License) comme publiée par la Free Software Foundation; la version 2 de cette license ou (comme vous le voulez) une version plus récente.
Ce programme est distribué dans l'espoir d'être utile, mais SANS AUCUNE GARANTIE. Voyez le fichier LICENSE fourni avec ce programme pour plus d'information.
Minimum système
Linux
ConvertAll requiert les librairies suivantes :
Python (Version 3.2 or higher)
Qt (Version 4.6 or higher - voyez Trolltech pour plus d'information)
PyQt (Version 4.8 or higher - voyez Riverbank
pour plus d'information)
Ces librairies sont relativement nouvelles. Des paquets n'existent peut-être pas pour votre distribution. Dans ce cas, une version antérieure de ConvertAll (0.3.2) est toujours disponible.
Windows
En utilisant les binaires de ConvertAll, n'importe quel PC utilsant Windows XP, Vista, Windows 7 ou Windows 8 devrait fonctionner.
Installation
Linux
Extraire les sources du fichier tar de convertall. Ensuite, allez dans le dossier ConvertAll. Pour une utilisation de base, tapez la commande suivante en mode super utilisateur (root) : python install.py
Pour les options, utilisez: python install.py -h
Pour installer ConvertAll avec un prefix différent (par défaut c'est
/usr/local), utilisez: python install.py -p
/prefix/path
Windows
Simplement utiliser le fichier téléchargé (convertall-x.x.x-install-all.exe). Cela installera les fichiers nécessaires, fera les associations et créera les raccourcis.
Si vous souhaitez modifier le code source ou écrire vos propres programmes PyQt pour Windows, n'utilisez pas les procédures ci-haut. À la place, vous devez installer Python et les fichiers binaires pour PyQt. Ensuite, extraire le code source et les fichiers de données de la version Linux (fichier tar convertall) dans un dossier de votre choix et exécuter convertall.py
Utiliser ConvertAll
Bases
Simplement écrire le nom d'une unité dans le champ "de l'unité". Au fur que vous écrivez, une liste apparaîtra et vous pourrez sélectionner la bonne. Tapez l'abréviation complète, le nom complet ou sélectionné en un dans la liste et taper retour. Cliquer avec la souris fonctionne également tout comme les flèches haut et bas.
Refaire les mêmes étapes dans le champ "vers l'unité". Quand vous aurez terminé, si les unités sont compatibles, vous verrez un champ pour entrer des valeurs numériques sous les listes. Entrer un nombre dans un champ et vous verrez le résultat de la conversion dans l'autre champ.
Combiner les unités
La force de ConvertAll repose dans son habileté à combiner plusieurs unités. Écrivez simplement le nom de deux unités avec un "*" ou un "/" entre eux. Ainsi, cela permet les km/h ou les j/s. Le symbole "^" peut être utilisé pour des m?? "m^2". Même les exposants négatifs "sec^-1" sont possibles, mais le symbole de la division apparaîtra. ("m*sec^-2" deviendra "m/sec^2")
Dans ConvertAll, la multiplication passe avant la division. Donc "m/sec*h" veut dire "m/(sec*h)". Donc, "m/sec/h" revient au même que "m*h/sec". Faites donc attention aux priorités.
Les boutons sous les listes d'unités ('X', '/', '^2', '^3') placeront l'opérateur sur l'unité le plus près du curseur.
Aussi, cliquer sur une unité dans la liste remplace généralement l'unité la plus près du curseur.
Le bouton "Effacer l'unité" sous les opérateurs peu être utilisé pour nettoyer le champ et ainsi laissez de la place pour une nouvelle unité.
Raccouris
Quand vous tapez le nom d'une unité, les espaces seront ignorés. Ils peuvent donc être sautés. Le pluriel aussi est ignoré. Quand vous avez entré un nom partiel d'unité, si vous tapez retour, le nom s'écrira au complet. Si vous utilisez la touche TAB, le curseur ira au champ suivant en plus.
Le nombre devant être converti peut être entré dans le champ "De" ou "Vers" sans problème. La notation décimale et scientifique peuvent être utilisés tout comme les expressions usuelles en mathématique (+, -, *, /, **).
Trouver une unité
Le chercheur d'unité peut être utilisé pour filtrer les unités par type et/ou pour chercher des unités en utilisant une chaîne de caractères. Cela fera apparaître une liste séparée dans une nouvelle fenêtre. Cette liste sera ensuite mise à jour en fonction des filtres utilisés.
Les boutons près du bas de la fenêtre du chercheur ajoutent l'unité sélectionnée dans la fenêtre principale. Le bouton "Remplacer" remplace toutes les unités combinées par la sélection. Le bouton "Insertion" remplace seulement la partie active des unités.
Options
Le bouton "Options..." permet de changer les paramètres par défaut. Les nouveaux paramètres sont enregistrés automatiquement, donc à la prochaine utilisation de ConvertAll, vos paramètres modifiés seront encore présents.
Les premières options contrôlent l'affichage de résultats numériques, incluant l'utilisation de notation scientifique et le nombre de décimales. Faites attention si vous mettez un très petit nombre de décimal, car tout deviendrait moins précis. Six décimales ou plus sont recommandées (par défaut c'est huit).
Il y a une option pour cacher les boutons des opérateurs (x, /,
^2, ^3 and Clear Unit). Ils peuvent être cachés pour sauver de l'espace si le clavier est utilisé pour entrer ces opérateurs.
Des boutons sont aussi disponibles pour changer la couleur des champs de texte.
Conversion non linéaire
La conversion de quelques unités est non linéaire (non proportionnel). La conversion de la température des Fahrenheit et des Celsius est un exemple de conversion non linéaire. Les unités non linéaires sont identifiées dans les commentaires (à droite de la colonne "Type").
Ces unités ne peuvent être converties que lorsqu'ils sont utilisés seuls et sans exposants. Sinon la conversion ne sera pas juste.
Utilisation de la ligne de commande
Les conversions peuvent être faites à partir de la ligne de commande (dans un terminal Linux ou DOS). Entrer la commande ("convertall"), le nombre, l'unité à partir de et l'unité vers (le tout séparé par des espaces) pour faire une conversion. Les unités dont le nom comporte des espaces doit être entourées de guillemets. Encore, si vous voulez qu'on vous demande les entrées, utilisez "convertall -i" en ligne de commande.
Une fois la conversion terminée, ConvertAll vous demandera pour un nouveau nombre pour faire la même conversion. Vous pourrez soit utiliser "r" pour faire la conversion inverse ou "q" pour quitter.
Pour la liste complète des options, entrer "convertall -h" à l'invite.
Historique
23 mars 2010 - Version 0.4.90
Nouveautés :
La multiplication et la division ont la même importance. Les priorités d'opérations mathématiques seront donc respectées.
Les parenthèses sont supportés pour grouper des unités au dénominateur. Par exemple, " m / sec / kg " peut maintenant être écrit " m / (sec * kg) ".
Un boutton "Unité récente" a été ajouté et ouvre un menu affichant les unités ou combinaisons d'unités récentes. Vous trouverez aussi un nouveau menu pour choisir la longueure de cette nouvelle option.
Nous avons ajoutés des traductions allemande et française pour l'interface graphique et le fichier d'unités. Pour les utiliser, téléchargez et installez le fichier "convertall-il8n..." spécifique à votre système (en plus de l'installateur stantard de ConvertAll).
L'historique complet du logiciel peut être trouvé dans la version anglaise du fichier README.
Questions, Commentaires, Critiques?
Vous pouvez me contacter par email à l'adresse : doug101 AT bellz.org Tous les commentaires sont les bienvenus incluant les rapports de bogues. Aussi, vérifié périodiquement au www.bellz.org pour les mises à jour.
ConvertAll/doc/INSTALL 0000644 0001750 0001750 00000000636 10736723300 013411 0 ustar doug doug ConvertAll Installation Notes
Extract the source files from the convertall tar file, then change to the
'ConvertAll' directory in a terminal. For a basic installation, simply
execute the following command as root: 'python install.py'
To see all install options, use: 'python install.py -h'
To install ConvertAll with a different prefix (the default is
'/usr/local'), use: 'python install.py -p /prefix/path'
ConvertAll/doc/LICENSE 0000644 0001750 0001750 00000043103 10736723300 013361 0 ustar doug doug GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
ConvertAll/data/ 0000755 0001750 0001750 00000000000 12273245404 012521 5 ustar doug doug ConvertAll/data/units.dat 0000644 0001750 0001750 00000066332 12273245376 014377 0 ustar doug doug #*****************************************************************************
#units.dat, the units data file, version 0.6.0
#
# ConvertAll, a units conversion program
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, Version 2. This program is
# distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY.
#*****************************************************************************
#
# Units are defined by an optional quantity and an equivalent unit or unit
# combination. A Python expression may be used for the quantity, but is
# restricted to using only the following operators: *, /, +, -, **, (, ).
# Beware of integer division truncation: be sure to use a float for at least
# one of the values.
#
# The unit type must be placed in square brackets before a set of units. The
# first comment after the equivalent unit will be put in parenthesis after the
# unit name (usually used to give the full name of an abbreviated unit). The
# next comment will be used in the program list's comment column; later
# comments and full line comments are ignored.
#
# Non-linear units are indicated with an equivalent unit in square brackets,
# followed by either equations or equivalency lists for the definition. For
# equations, two are given, separated by a ';'. Both are functions of "x", the
# first going from the unit to the equivalent unit and the second one in
# reverse. Any valid Python expression returning a float (including the
# functions in the math module) should work. The equivalency list is a Python
# list of tuples giving points for linear interpolation.
#
# All units must reduce to primitive units, which are indicated by an
# equivalent unit starting with '!'. A special "unitless" primitve unit
# (usualty called "unit") has '!!' for an equivalent unit. Circular references
# must also be avoided.
#
# Primitive units: kg, m, s, K, A, mol, cd, rad, sr, bit, unit
#
##############################################################################
#
# mass units
#
[mass]
kg = ! # kilogram
kilogram = kg
key = kg # # drug slang
hectogram = 100 gram
dekagram = 10 gram
gram = 0.001 kg
g = gram # gram
decigram = 0.1 gram
centigram = 0.01 gram
milligram = 0.001 gram
mg = milligram # milligram
microgram = 0.001 mg
tonne = 1000 kg # # metric
metric ton = tonne
megagram = tonne
kilotonne = 1000 tonne # # metric
gigagram = 1e9 gram
teragram = 1e12 gram
carat = 0.2 gram
ct = carat # carat
amu = 1.66053873e-27 kg # atomic mass
atomic mass unit = amu
pound = 0.45359237 kg
lb = pound # pound
lbm = pound # pound
ounce = 1/16.0 pound
oz = ounce # ounce
lid = ounce # # drug slang
pound troy = 5760 grain
lb troy = pound troy # pound troy
ounce troy = 1/12.0 lb troy
oz troy = ounce troy # ounce troy
ton = 2000 lb # # non-metric
kiloton = 1000 ton # # non-metric
long ton = 2240 lb # # Imperial
slug = lbf*s^2/ft
stone = 14 lb
grain = 1/7000.0 lb
pennyweight = 24 grain
hundredweight long = 112 lb # # Imperial
hundredweight short = 100 lb # # US & Canada
solar mass = 1.9891e30 kg
#
# length / distance units
#
[length]
m = ! # meter
meter = m
metre = m
decimeter = 0.1 m
cm = 0.01 m # centimeter
centimeter = cm
mm = 0.001 m # millimeter
millimeter = mm
micrometer = 1e-6 m
micron = micrometer
nanometer = 1e-9 m
nm = nanometer # nanometer
dekameter = 10 m
hectometer = 100 m
km = 1000 m # kilometer
kilometer = km
megameter = 1000 km
angstrom = 1e-10 m
fermi = 1e-15 m # # nuclear sizes
inch = 2.54 cm
in = inch # inch
inches = inch
mil = 0.001 inch
microinch = 1e-6 inch
microinches = microinch
foot = 12 inch
ft = foot # foot
feet = foot
foot US survey = 1200/3937.0 m
yard = 3 ft
yd = yard # yard
mile = 5280 ft # # statute mile
mi = mile # mile # statute mile
nautical mile = 1852 m
nmi = nautical mile # nautical mile
mile US survey = 5280 foot US survey
league = 3 mile
chain = 66 ft
chain US survey = 66 foot US survey
link = 0.01 chain
fathom = 6 ft
rod = 5.5 yard
furlong = 40 rod
hand = 4 inch
cubit = 21.8 inch # # biblical unit
point = 1/72.0 inch # # desktop publishing point
pica = 12 point
caliber = 0.01 inch # # bullet sizes
rack unit = 1.75 in # # computing
football field = 100 yd
marathon = 46145 yd
mil Swedish = 10 km
versta = 3500 ft # # Russian unit
au = 1.49597870691e11 m # astronomical unit
astronomical unit = au
LD = 384400 km # lunar distance # astronomical
lunar distance = LD # # astronomical distance
light year = 365.25 light speed * day
light minute = light speed * min
light second = light speed * s
parsec = 3.0856775813e16 m
kiloparsec = 1000 parsec
megaparsec = 1000 kiloparsec
screw size = [in] 0.013*x + 0.06 ; (x - 0.06) / 0.013 \
# # Unified diameters, non-linear
AWG Dia = [in] 92.0**((36-x)/39.0)/200.0 ; \
36 - 39.0*log(200.0*x)/log(92.0) \
# American Wire Gauge \
# use -1, -2 for 00, 000; non-linear
American Wire Gauge Dia = [in] 92.0**((36-x)/39.0)/200.0 ; \
36 - 39.0*log(200.0*x)/log(92.0) \
# # use -1, -2 for 00, 000; non-linear
standard gauge = [in] [(-5, .448350), (1, .269010), (14, .0747250), \
(16, .0597800), (17, .0538020), (20, .0358680), \
(26, .0179340), (31, .0104615), (36, .00672525), \
(38, .00597800)] # steel \
# Manufacturers Std. Gauge, non-linear
zinc gauge = [in] [(1, .002), (10, .02), (15, .04), (19, .06), \
(23, .1), (24, .125), (27, .5), (28, 1)] \
# # sheet metal thickness, non-linear
ring size = [in] 0.1018*x + 1.4216 ; (x - 1.4216) / 0.1018 \
# # US size, circum., non-linear
shoe size mens = [in] x/3.0 + 7 + 1/3.0 ; (x - 7 - 1/3.0) * 3 \
# # US sizes, non-linear
shoe size womens = [in] x/3.0 + 6 + 5/6.0 ; (x - 6 - 5/6.0) * 3 \
# # US sizes, non-linear
#
# time units
#
[time]
s = ! # second
sec = s # second
second = s
ms = 0.001 s # millisecond
millisecond = ms
microsecond = 1e-6 s
ns = 1e-9 s # nanosecond
nanosecond = ns
minute = 60 s
min = minute # minute
hour = 60 min
hr = hour # hour
bell = 30 min # # naval definition
watch = 4 hour
watches = watch
day = 24 hr
week = 7 day
wk = week # week
fortnight = 14 day
month = 1/12.0 year
year = 365.242198781 day
yr = year # year
calendar year = 365 day
decade = 10 year
century = 100 year
centuries = century
millennium = 1000 year
millennia = millennium
[scheduling]
man hour = 168/40.0 hour
man week = 40 man hour
man month = 1/12.0 man year
man year = 52 man week
#
# temperature
#
[temperature]
K = ! # Kelvin
Kelvin = K
deg K = K # Kelvin
degree Kelvin = K
C = [K] x + 273.15 ; x - 273.15 # Celsius # non-linear
Celsius = [K] x + 273.15 ; x - 273.15 # # non-linear
deg C = [K] x + 273.15 ; x - 273.15 # Celsius # non-linear
degree Celsius = [K] x + 273.15 ; x - 273.15 # # non-linear
R = 5/9.0 K # Rankine
Rankine = R
deg R = R # Rankine
F = [R] x + 459.67 ; x - 459.67 # Fahrenheit # non-linear
Fahrenheit = [R] x + 459.67 ; x - 459.67 # # non-linear
deg F = [R] x + 459.67 ; x - 459.67 # Fahrenheit # non-linear
degree Fahrenheit = [R] x + 459.67 ; x - 459.67 # # non-linear
[temp. diff.]
C deg = K # Celsius degree
Celsius degree = C deg
F deg = R # Fahrenheit deg.
Fahrenheit degree = F deg
#
# electrical units
#
[current]
A = ! # ampere
ampere = A
amp = A
milliampere = 0.001 A
milliamp = milliampere
mA = milliampere # milliampere
microampere = 0.001 mA
kiloampere = 1000 A
kA = kiloampere # kiloampere
[charge]
coulomb = A*s
amp hour = A*hr
mAh = 0.001 amp hour # milliamp hour
milliamp hour = mAh
[potential]
volt = W/A
V = volt # volt
millivolt = 0.001 volt
mV = millivolt # millivolt
kilovolt = 1000 volt
kV = kilovolt # kilovolt
[resistance]
ohm = V/A
milliohm = 0.001 ohm
microhm = 0.001 milliohm
kilohm = 1000 ohm
[conductance]
siemens = A/V
[capacitance]
farad = coulomb/V
millifarad = 0.001 farad
microfarad = 0.001 millifarad
nanofarad = 1e-9 farad
picofarad = 1e-12 farad
[magn. flux]
weber = V*s
Wb = weber # weber
maxwell = 1e-8 Wb
[inductance]
henry = Wb/A
H = henry # henry
millihenry = 0.001 henry
mH = millihenry # millihenry
microhenry = 0.001 mH
[flux density]
tesla = Wb/m^2
T = tesla # tesla
gauss = maxwell/cm^2
#
# molecular units
#
[molecular qty]
mol = ! # mole # gram mole
mole = mol # # gram mole
gram mole = mol
kilomole = 1000 mol
kmol = kilomole # kilomole
pound mole = mol*lbm/gram
lbmol = pound mole # pound mole
[size of a mol]
avogadro = gram/(amu*mol)
#
# Illumination units
#
[lum. intens.]
cd = ! # candela
candela = cd
[luminous flux]
lumen = cd * sr
lm = lumen # lumen
[illuminance]
lux = lumen/m^2
footcandle = lumen/ft^2
metercandle = lumen/m^2
[luminance]
lambert = cd/(pi*cm^2)
millilambert = 0.001 lambert
footlambert = cd/(pi*ft^2)
#
# angular units
#
[angle]
radian = !
rad = radian # radian
circle = 2 pi*radian
turn = circle
revolution = circle
rev = revolution # revolution
degree = 1/360.0 circle
deg = degree # degree
arc min = 1/60.0 degree # minute
arc minute = arc min
min arc = arc min # minute
minute arc = arc min
arc sec = 1/60.0 arc min # second
arc second = arc sec
sec arc = arc sec # second
second arc = arc sec
quadrant = 1/4.0 circle
right angle = quadrant
gradian = 0.01 quadrant
#
# solid angle units
#
[solid angle]
sr = ! # steradian
steradian = sr
sphere = 4 pi*sr
hemisphere = 1/2.0 sphere
#
# information units
#
[data]
bit = !
kilobit = 1000 bit # # based on power of 10
megabit = 1000 kilobit # # based on power of 10
byte = 8 bit
B = byte # byte
kilobyte = 1024 byte # # based on power of 2
kB = kilobyte # kilobyte # based on power of 2
megabyte = 1024 kB # # based on power of 2
MB = megabyte # megabyte # based on power of 2
gigabyte = 1024 MB # # based on power of 2
GB = gigabyte # gigabyte # based on power of 2
terabyte = 1024 GB # # based on power of 2
TB = terabyte # terabyte # based on power of 2
petabyte = 1024 TB # # based on power of 2
PB = petabyte # petabyte # based on power of 2
kilobyte IEC std = 1000 byte # # based on power of 10
kB IEC std = kilobyte IEC std # kilobyte # based on power of 10
megabyte IEC std = 1000 kB IEC std # # based on power of 10
MB IEC std = megabyte IEC std # megabyte # based on power of 10
gigabyte IEC std = 1000 MB IEC std # # based on power of 10
GB IEC std = gigabyte IEC std # gigabyte # based on power of 10
terabyte IEC std = 1000 GB IEC std # # based on power of 10
TB IEC std = terabyte IEC std # terabyte # based on power of 10
petabyte IEC std = 1000 TB IEC std # # based on power of 10
PB IEC std = petabyte IEC std # petabyte # based on power of 10
kibibyte = 1024 byte
KiB = kibibyte # kibibyte
mebibyte = 1024 KiB
MiB = mebibyte # mebibyte
gibibyte = 1024 MiB
GiB = gibibyte # gibibyte
tebibyte = 1024 GiB
TiB = tebibyte # tebibyte
pebibyte = 1024 TiB
PiB = pebibyte # pebibyte
[data transfer]
bps = bit/sec # bits / second
kbps = 1000 bps # kilobits / sec. # based on power of 10
#
# Unitless numbers
#
[quantity]
unit = !!
1 = unit # unit
pi = 3.14159265358979323846 unit
pair = 2 unit
hat trick = 3 unit # # sports
dozen = 12 unit
doz = dozen # dozen
bakers dozen = 13 unit
score = 20 unit
gross = 144 unit
great gross = 12 gross
ream = 500 unit
percent = 0.01 unit
% = percent
mill = 0.001 unit
[interest rate]
APR = [unit] log(1 + x/100) ; (exp(x) - 1)*100 \
# annual % rate # based on continuous compounding
[concentration]
proof = 1/200.0 unit # # alcohol content
ppm = 1e-6 unit # parts per million
parts per million = ppm
ppb = 1e-9 unit # parts per billion
parts per billion = ppb
ppt = 1e-12 unit # parts per trillion
parts per trillion = ppt
karat = 1/24.0 unit # # gold purity
carat gold = karat # # gold purity
#
# force units
#
[force]
newton = kg*m/s^2
N = newton # newton
dekanewton = 10 newton
kilonewton = 1000 N
kN = kilonewton # kilonewton
meganewton = 1000 kN
millinewton = 0.001 N
dyne = cm*g/s^2
kg force = kg * gravity # kilogram f
kgf = kg force # kilogram force
kilogram force = kg force
kp = kg force # kilopond
kilopond = kg force
gram force = g * gravity
pound force = lbm * gravity
lbf = pound force # pound force
ton force = ton * gravity
ounce force = ounce * gravity
ozf = ounce force # ounce force
tonne force = tonne * gravity # # metric
pdl = lbm * ft / sec^2 # poundal # Imperial force
poundal = pdl # # Imperial force
#
# area units
#
[area]
barn = 1e-28 m^2 # # particle physics
are = 100 m^2
decare = 10 are
dekare = 10 are
hectare = 100 are
stremma = 1000 m^2
acre = 10 chain^2
section = mile^2
township = 36 section
homestead = 160 acre
rai = 1600 m^2 # # Thai
ngaan = 400 m^2 # # Thai
circular inch = 1/4.0 pi*in^2 # # area of 1 inch circle
circular mil = 1/4.0 pi*mil^2 # # area of 1 mil circle
AWG Area = [in^2] pi/4*(92.0**((36-x)/39.0)/200.0)**2 ; \
sqrt(36 - 39.0*log(200.0*x)/log(92.0))*4/pi \
# American Wire Gauge \
# use -1, -2 for 00, 000; non-linear
American Wire Gauge Area = [in^2] pi/4*(92.0**((36-x)/39.0)/200.0)**2 ; \
sqrt(36 - 39.0*log(200.0*x)/log(92.0))*4/pi \
# # use -1, -2 for 00, 000; non-linear
#
# volume units
#
[volume]
cc = cm^3 # cubic centimeter
cubic centimeter = cc
liter = 1000 cc
l = liter # liter
litre = liter
deciliter = 0.1 liter
centiliter = 0.01 liter
milliliter = cc
ml = milliliter # milliliter
microliter = 1e-6 liter
dekaliter = 10 liter
hectoliter = 100 liter
kiloliter = 1000 liter
kl = kiloliter # kiloliter
megaliter = 1000 kiloliter
gallon = 231 in^3 # # US liquid
gal = gallon # gallon # US liquid
quart = 1/4.0 gallon # # US liquid
qt = quart # quart # US liquid
pint = 1/2.0 quart # # US liquid
pt = pint # pint # US liquid
fluid ounce = 1/16.0 pint # # US
fl oz = fluid ounce # fluid ounce # US
ounce fluid = fluid ounce # # US
imperial gallon = 4.54609 liter
imp gal = imperial gallon # imperial gallon
gallon imperial = imperial gallon
imperial quart = 1/4.0 imp gal
imp qt = imperial quart # imperial quart
quart imperial = imperial quart
imperial pint = 1/8.0 imp gal
imp pt = imperial pint # imperial pint
pint imperial = imperial pint
imperial fluid ounce = 1/160.0 imp gal
imp fl oz = imperial fluid ounce # imperial fluid ounce
cup = 8 fl oz
tablespoon = 1/16.0 cup
tbsp = tablespoon # tablespoon
teaspoon = 1/3.0 tbsp
tsp = teaspoon # teaspoon
barrel = 42 gallon
bbl = barrel # barrel
shot = 1.5 fl oz
fifth = 1/5.0 gallon # # alcohol
wine bottle = 750 ml
magnum = 1.5 liter # # alcohol
keg = 15.5 gallon # # beer
hogshead wine = 63 gal
hogshead beer = 54 gal
bushel = 2150.42 in^3
peck = 1/4.0 bushel
cord = 128 ft^3
board foot = ft^2*in
board feet = board foot
#
# velocity units
#
[velocity]
knot = nmi/hr
kt = knot # knot
light speed = 2.99792458e8 m/s
mph = mi/hr # miles/hour
kph = km/hr # kilometers/hour
mach = 340.29 m/s # # speed sound at STP
[rot. velocity]
rpm = rev/min # rev/min
rps = rev/sec # rev/sec
#
# flow rate units
#
[fluid flow]
gph = gal/hr # gallons/hour
gpm = gal/min # gallons/minute
cfs = ft^3/sec # cu ft/second
cfm = ft^3/min # cu ft/minute
lpm = l/min # liter/min
[gas flow]
sccm = atm*cc/min # std cc/min # pressure * flow
sccs = atm*cc/sec # std cc/sec # pressure * flow
slpm = atm*l/min # std liter/min # pressure * flow
slph = atm*l/hr # std liter/hour # pressure * flow
scfh = atm*ft^3/hour # std cu ft/hour # pressure * flow
scfm = atm*ft^3/min # std cu ft/min # pressure * flow
#
# pressure units
#
[pressure]
Pa = N/m^2 # pascal
pascal = Pa
hPa = 100 Pa # hectopascal
hectopascal = hPa
kPa = 1000 Pa # kilopascal
kilopascal = kPa
MPa = 1000 kPa # megapascal
megapascal = MPa
GPa = 1000 MPa # gigapascal
gigapascal = GPa
atm = 101325 Pa # atmosphere
atmosphere = atm
bar = 1e5 Pa
mbar = 0.001 bar # millibar
millibar = mbar
microbar = 0.001 mbar
decibar = 0.1 bar
kilobar = 1000 bar
megabar = 1000 kilobar
mm Hg = mm*density Hg*gravity
millimeter of Hg = mm Hg
torr = mm Hg
micron of Hg = micron*density Hg*gravity
in Hg = in*density Hg*gravity # inch of Hg
inch of Hg = in Hg
m water = m*density water*gravity # meter of H2O
m H2O = m water # meter of H2O
meter of water = m water
in water = in*density water*gravity # inch of H2O
in H2O = in water # inch of H2O
inch of water = in water
ft water = ft*density water*gravity # feet of H2O
ft H2O = ft water # feet of H20
feet of water = ft water
foot of head = ft water
ft hd = ft water # foot of head
psi = lbf/in^2 # pound / sq inch
pound per sq inch = psi
ksi = 1000 psi # 1000 lb / sq inch
#
# density units
#
[density]
density water = gram/cm^3
density sea water = 1.025 gram/cm^3
density Hg = 13.5950981 gram/cm^3
density air = 1.293 kg/m^3 # # at STP
density steel = 0.283 lb/in^3 # # carbon steel
density aluminum = 0.098 lb/in^3
density zinc = 0.230 lb/in^3
density brass = 0.310 lb/in^3 # # 80Cu-20Zn
density copper = 0.295 lb/in^3
density iron = 0.260 lb/in^3 # # cast iron
density nickel = 0.308 lb/in^3
density tin = 0.275 lb/in^3
density titanium = 0.170 lb/in^3
density silver = 0.379 lb/in^3
density nylon = 0.045 lb/in^3
density polycarbonate = 0.045 lb/in^3
#
# energy units
#
[energy]
joule = N*m
J = joule # joule
kilojoule = 1000 joule
kJ = kilojoule # kilojoule
megajoule = 1000 kilojoule
gigajoule = 1000 megajoule
millijoule = 0.001 joule
mJ = millijoule # millijoule
calorie = 4.1868 J
cal = calorie # calorie
kilocalorie = 1000 cal
kcal = kilocalorie # kilocalorie
calorie food = kilocalorie
thermie = 1000 kcal
Btu = cal*lb*R/(g*K) # British thermal unit
British thermal unit = Btu
therm = 100000 Btu
erg = cm*dyne
electronvolt = 1.602176462e-19 J
eV = electronvolt # electronvolt
kWh = kW*hour # kilowatt-hour
kilowatt hour = kWh
ton TNT = 4.184e9 J
tonne oil equivalent = 41.868 gigajoule
tonne coal equivalent = 7000000 kcal
#
# power units
#
[power]
watt = J/s
W = watt # watt
kilowatt = 1000 W
kW = kilowatt # kilowatt
megawatt = 1000 kW
MW = megawatt # megawatt
gigawatt = 1000 MW
GW = gigawatt # gigawatt
milliwatt = 0.001 W
horsepower = 550 ft*lbf/sec
hp = horsepower # horsepower
metric horsepower = 75 kgf*m/s
ton refrigeration = 12000 Btu/hr
#
# frequency
#
[frequency]
hertz = unit/sec
Hz = hertz # hertz
millihertz = 0.001 Hz
kilohertz = 1000 Hz
kHz = kilohertz # kilohertz
megahertz = 1000 kHz
MHz = megahertz # megahertz
gigahertz = 1000 MHz
GHz = gigahertz # gigahertz
#
# radioactivity
#
[radioactivity]
becquerel = unit/sec
Bq = becquerel # becquerel
curie = 3.7e10 Bq
millicurie = 0.001 curie
roentgen = 2.58e-4 coulomb/kg
[radiation dose]
gray = J/kg
Gy = gray # gray
centigray = 0.01 Gy
rad. abs. dose = 0.01 Gy # # commonly rad
sievert = J/kg # # equiv. dose
millisievert = 0.001 sievert # # equiv. dose
Sv = sievert # sievert # equiv. dose
rem = 0.01 Sv # # roentgen equiv mammal
millirem = 0.001 rem # # roentgen equiv mammal
#
# viscosity
#
[dyn viscosity]
poise = g/(cm*s)
P = poise # poise
centipoise = 0.01 poise
cP = centipoise # centipoise
[kin viscosity]
stokes = cm^2/s
St = stokes # stokes
centistokes = 0.01 stokes
cSt = centistokes # centistokes
#
# misc. units
#
[acceleration]
gravity = 9.80665 m/s^2
galileo = cm/s^2
[constant]
gravity constant = 6.673e-11 N*m^2/kg^2
gas constant = 8.314472 J/(mol*K) # R
[fuel consumpt.]
mpg = mi/gal # miles/gallon
mpg imp = mi/gallon imperial # miles/gallon imp
liter per 100 km = [mpg] 3.785411784 / (x * 0.01609344) ; \
3.785411784 / (x * 0.01609344) # # non-linear
[permeability]
darcy = 1 cm^2*centipoise/atm/s
millidarcy = 0.001 darcy
ConvertAll/data/units_fr.dat 0000644 0001750 0001750 00000063257 12273245376 015071 0 ustar doug doug #*****************************************************************************
# units.dat, the units data file, version 0.6.0
#
# ConvertAll, a units conversion programme
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, Version 2. This programme is
# distributed in the hope that it will be useful, but WITTHOUT ANY WARRANTY.
#*****************************************************************************
#
# Units are defined by an optional quantity and an equivalent unit or unit
# combination. A python expression may be used for the quantity, but is
# resticted to using only the following operators: *, /, +, -, **, (, ).
# Beware of integer division truncation: be sure to use a float for at
# least one of the values.
#
# The unit type must be placed in square brackets before a set of units.
# The first comment after the equivalent unit will be put in parenthesis after
# the unit name (usually used to give the full name of an abbreviated unit).
# The next comment will be used in the programme list's comment column;
# later comments and full line comments are ignored.
#
# Non-linear units are indicated with an equivalent unit in square brackets,
# followed by either equations or equivalency lists for the definition.
# For equations, two are given, separated by a ';'. Both are functions of
# "x", the first going from the unit to the equivalent unit and the second
# one in reverse. Any valid Python expression returning a float (including
# the functions in the math module) should work. The equivalency list is a
# python list of tuples giving points for linear interpolation.
#
# All units must reduce to primitive units, which are indicated by an
# equivalent unit starting with '!'. A special "unitless" primitve unit
# (usualty called "unit") has '!!' for an equivalent unit. Circular references
# must also be avoided.
#
# Primitive units: kg, m, s, K, A, mol, cd, rad, sr, bit, unit
#
##############################################################################
#
# mass units
#
[masse]
kg = ! # kilogramme
kilogramme = kg
key = kg # # jargon de drogue
hectogramme = 100 gramme
decagramme = 10 gramme
gramme = 0.001 kg
g = gramme # gramme
decigramme = 0.1 gramme
centigramme = 0.01 gramme
milligramme = 0.001 gramme
mg = milligramme # milligramme
microgramme = 0.001 mg
tonne = 1000 kg # # metriqu
tonne metrique = tonne
megagramme = tonne
kilotonne = 1000 tonne # # metrique
gigagramme = 1e9 gramme
teragramme = 1e12 gramme
carat = 0.2 gramme
ct = carat # carat
amu = 1.66053873e-27 kg # masse atomique
masse atomique = amu
livre = 0.45359237 kg
lb = livre # livres
lbm = livre # livres
once = 1/16.0 livre
oz = once # once
lid = once # # jargon de drogue
livre troy = 5760 grain
lb troy = livre troy # livre troy
once troy = 1/12.0 lb troy
oz troy = once troy # once troy
ton = 2000 lb # # impériale
kiloton = 1000 ton # # impériale
slug = lbf*s^2/ft
stone = 14 lb
grain = 1/7000.0 lb
pennyweight = 24 grain
masse solaire = 1.9891e30 kg
#
# length / distance units
#
[longueur]
m = ! # mètre
mètre = m
decimètre = 0.1 m
cm = 0.01 m # centimètre
centimètre = cm
mm = 0.001 m # millimètre
millimètre = mm
micromètre = 1e-6 m
micron = micromètre
nanomètre = 1e-9 m
nm = nanomètre # nanomètre
decamètre = 10 m
hectomètre = 100 m
km = 1000 m # kilomètre
kilomètre = km
megamètre = 1000 km
angstrom = 1e-10 m
fermi = 1e-15 m # # grandeur nucléaire
pouce = 2.54 cm
in = pouce # pouce
inches = pouce
mil = 0.001 pouce
microinch = 1e-6 pouce
microinches = microinch
pied = 12 pouce
ft = pied # pied
feet = pied
pied US survey = 1200/3937.0 m
verge = 3 ft
yd = verge # verge
mile = 5280 ft
mi = mile # mille
nautical mile = 1852 m
nmi = nautical mile # mille nautique
league = 3 mile
chain = 66 ft
brasse = 6 ft
fm = brasse
perche = 5.5 verge
furlong = 40 perche
main = 4 pouce
cubit = 21.8 pouce # # coudée biblique
point = 1/72.0 pouce # # point de caractère
pica = 12 point
calibre = 0.01 pouce # # calibre d'une arme
terrain de football = 100 yd
marathon = 46145 yd
mille suedois = 10 km
ua = 1.49597870691e11 m # unité astronomique
unite astronomique = ua
annee lumiere = 365.25 vitesse lumiere * jour
minute lumiere = vitesse lumiere * min
seconde lumiere = vitesse lumiere * s
parsec = 3.0856775813e16 m
kiloparsec = 1000 parsec
megaparsec = 1000 kiloparsec
screw size = [in] 0.013*x + 0.06 ; (x - 0.06) / 0.013 \
# # Diamètre unifié, non linéaire
AWG = [in] 92.0**((36-x)/39.0)/200.0 ; \
36 - 39.0*log(200.0*x)/log(92.0) \
# Diamètre de câble électrique \
# utilisé -1, -2 for 00, 000; non linéaire
American Wire Gauge = [in] 92.0**((36-x)/39.0)/200.0 ; \
36 - 39.0*log(200.0*x)/log(92.0) \
# # utilisé -1, -2 for 00, 000; non linéaire
standard gauge = [in] [(-5, .448350), (1, .269010), (14, .0747250), \
(16, .0597800), (17, .0538020), (20, .0358680), \
(26, .0179340), (31, .0104615), (36, .00672525), \
(38, .00597800)] # acier \
# Diamètre standard, non linéaire
zinc gauge = [in] [(1, .002), (10, .02), (15, .04), (19, .06), \
(23, .1), (24, .125), (27, .5), (28, 1)] \
# # épaisseur de la feuille de métal, non linéaire
taille bague = [in] 0.1018*x + 1.4216 ; (x - 1.4216) / 0.1018 \
# # Taille américaine, circ., non linéaire
grandeur soulier homme = [in] x/3.0 + 7 + 1/3.0 ; (x - 7 - 1/3.0) * 3 \
# # Taille américainre, non linéaire
grandeur soulier femme = [in] x/3.0 + 6 + 5/6.0 ; (x - 6 - 5/6.0) * 3 \
# # Taille américainre, non linéaire
#
# unités de temps
#
[temps]
s = ! # seconde
sec = s # seconde
seconde = s
ms = 0.001 s # milliseconde
milliseconde = ms
microseconde = 1e-6 s
ns = 1e-9 s # nanoseconde
nanoseconde = ns
minute = 60 s
min = minute # minute
heure = 60 min
hr = heure # heure
bell = 30 min # # définition nautique
watch = 4 heure
watches = watch
jour = 24 hr
semaine = 7 jour
wk = semaine # semaine
fortnight = 14 jour
mois = 1/12.0 annee
annee = 365.242198781 jour
yr = annee # année
annee calendrier = 365 jour
decennie = 10 annee
siecle = 100 annee
siecles = siecle
millenaire = 1000 annee
millennia = millenaire
[horaire]
man heure = 168/40.0 heure
man week = 40 man heure
man month = 1/12.0 man year
man year = 52 man week
#
# température
#
[temperature]
K = ! # Kelvin
Kelvin = K
deg K = K # Kelvin
degree Kelvin = K
C = [K] x + 273.15 ; x - 273.15 # Celsius # non linéaire
Celsius = [K] x + 273.15 ; x - 273.15 # # non linéaire
deg C = [K] x + 273.15 ; x - 273.15 # Celsius # non linéaire
degre Celsius = [K] x + 273.15 ; x - 273.15 # # non linéaire
R = 5/9.0 K # Rankine
Rankine = R
deg R = R # Rankine
F = [R] x + 459.67 ; x - 459.67 # Fahrenheit # non linéaire
Fahrenheit = [R] x + 459.67 ; x - 459.67 # # non linéaire
deg F = [R] x + 459.67 ; x - 459.67 # Fahrenheit # non linéaire
degree Fahrenheit = [R] x + 459.67 ; x - 459.67 # # non linéaire
[temp. diff.]
C deg = K # degré Celsius
Celsius degree = C deg
F deg = R # degré Fahrenheit
Fahrenheit degree = F deg
#
# electrical units
##
[intensité du courrant]
A = ! # ampère
ampère = A
amp = A
milliampère = 0.001 A
milliamp = milliampère
mA = milliampère # milliamèpre
microampère = 0.001 mA
kiloampère = 1000 A
kA = kiloampère # kiloampère
[charge]
coulomb = A*s
amp heure = A*hr
mAh = 0.001 amp heure # miliampère-heure
milliamp heure = mAh
[voltage]
volt = W/A
V = volt # volt
millivolt = 0.001 volt
mV = millivolt # millivolt
kilovolt = 1000 volt
kV = kilovolt # kilovolt
[resistance]
ohm = V/A
milliohm = 0.001 ohm
microhm = 0.001 milliohm
kilohm = 1000 ohm
[conductance]
siemens = A/V
[capacité]
farad = coulomb/V
millifarad = 0.001 farad
microfarad = 0.001 millifarad
nanofarad = 1e-9 farad
picofarad = 1e-12 farad
[flux mag.]
weber = V*s
Wb = weber # weber
maxwell = 1e-8 Wb
[inductance]
henry = Wb/A
H = henry # henry
millihenry = 0.001 henry
mH = millihenry # millihenry
microhenry = 0.001 mH
[flux de densité]
tesla = Wb/m^2
T = tesla # tesla
gauss = maxwell/cm^2
#
# molecular units
#
[quantité moléculaire]
mol = ! # mole # masse molaire
mole = mol # # masse molaire
gramme mole = mol
kilomole = 1000 mol
kmol = kilomole # kilomole
livre mole = mol*lbm/gramme
lbmol = livre mole # mole-livres
[nombre d'atomes]
avogadro = gramme/amu*mol
#
# Illumination units
#
[lum. intens.]
cd = ! # candela
candela = cd
[flux lumineux]
lumen = cd * sr
lm = lumen # lumen
[illuminance]
lux = lumen/m^2
footcandle = lumen/ft^2
mètrecandle = lumen/m^2
[luminance]
lambert = cd/pi*cm^2
millilambert = 0.001 lambert
footlambert = cd/pi*ft^2
#
# angular units
#
[angle]
radian = !
rad = radian # radian
cercle = 2 pi*radian
tour = cercle
revolution = cercle
rev = revolution # tour
degre = 1/360.0 cercle
deg = degre # degré
arc min = 1/60.0 degre # minute
arc minute = arc min
min arc = arc min # minute
minute arc = arc min
arc sec = 1/60.0 arc min # seconde
arc seconde = arc sec
sec arc = arc sec # seconde
seconde arc = arc sec
quadrant = 1/4.0 cercle
right angle = quadrant
gradian = 0.01 quadrant
#
# solid angle units
#
[angle dans les solides]
sr = ! # stéradian
steradian = sr
sphère = 4 pi*sr
hemisphère = 1/2.0 sphère
#
# information units
#
[données informatiques]
bit = !
kilobit = 1000 bit # # en base 10
megabit = 1000 kilobit # # en base 10
byte = 8 bit
B = byte # byte
kilobyte = 1024 byte # # en binaire
kB = kilobyte # kilobyte # en binaire
megabyte = 1024 kB # # en binaire
MB = megabyte # megabyte # en binaire
gigabyte = 1024 MB # # en binaire
GB = gigabyte # gigabyte # en binaire
terabyte = 1024 GB # # en binaire
TB = terabyte # terabyte # en binaire
petabyte = 1024 TB # # en binaire
PB = petabyte # petabyte # en binaire
kilobyte IEC std = 1000 byte # # en base 10
kB IEC std = kilobyte IEC std # kilobyte # en base 10
megabyte IEC std = 1000 kB IEC std # # en base 10
MB IEC std = megabyte IEC std # megabyte # en base 10
gigabyte IEC std = 1000 MB IEC std # # en base 10
GB IEC std = gigabyte IEC std # gigabyte # en base 10
terabyte IEC std = 1000 GB IEC std # # en base 10
TB IEC std = terabyte IEC std # terabyte # en base 10
petabyte IEC std = 1000 TB IEC std # # en base 10
PB IEC std = petabyte IEC std # petabyte # en base 10
kibibyte = 1024 byte
KiB = kibibyte # kibibyte
mebibyte = 1024 KiB
MiB = mebibyte # mebibyte
gibibyte = 1024 MiB
GiB = gibibyte # gibibyte
tebibyte = 1024 GiB
TiB = tebibyte # tebibyte
pebibyte = 1024 TiB
PiB = pebibyte # pebibyte
[transfert de donnée]
bps = bit/sec # bits / seconde
kbps = 1000 bps # kilobits / sec. # en base 10
#
# Unitless numbers
#
[quantitée]
unite = !!
1 = unite # unité
pi = 3.14159265358979323846 unite
paire = 2 unite
tour du chapeau = 3 unite # # sports
douzaine = 12 unite
doz = douzaine # douzaine
trieze à la douzaine = 13 unite
score = 20 unite
grosse = 144 unite
grande grosse = 12 grosse
ream = 500 unite
pourcent = 0.01 unite
% = pourcent
millieme = 0.001 unite
[taux d'intérêt]
APR = [unite] log(1 + x/100) ; (exp(x) - 1)*100 \
# annual % rate # based on continuous comlivreing
[concentration]
proof = 1/200.0 unite # # contenant d'alcool
ppm = 1e-6 unite # parties par million
partie par million = ppm
ppb = 1e-9 unite # parties par milliard
partie par milliard = ppb
ppt = 1e-12 unite # parties par billion
partie par billion = ppt
karat = 1/24.0 unite # # pureté de l'or
carat d'or = karat # # pureté de l'or
#
# force units
#
[force]
newton = kg*m/s^2
N = newton # newton
dekanewton = 10 newton
kilonewton = 1000 N
kN = kilonewton # kilonewton
meganewton = 1000 kN
millinewton = 0.001 N
dyne = cm*g/s^2
kg force = kg * acceleration gravitationnelle # kilogramme-force
kgf = kg force # kilogramme-force
kilogramme force = kg force
gramme force = g * acceleration gravitationnelle
livre force = lbm * acceleration gravitationnelle
lbf = livre force # livres-force
tonne force = tonne * acceleration gravitationnelle
once force = once * acceleration gravitationnelle
ozf = once force # once-force
#
# area units
#
[aire]
barn = 1e-28 m^2 # # physique des particules
are = 100 m^2
decare = 10 are
dekare = 10 are
hectare = 100 are
acre = 10 chain^2
section = mile^2
township = 36 section
homestead = 160 acre
rai = 1600 m^2 # # Thai
ngaan = 400 m^2 # # Thai
circular pouce = 1/4.0 pi*in^2 # # cercle d'un pouce de surface
circular mil = 1/4.0 pi*mil^2 # # cercle d'un mille de surface
#
# volume units
#
[volume]
cc = cm^3 # centimètre cube
centimètre cube = cc
litre = 1000 cc
l = litre # litre
liter = litre
decilitre = 0.1 litre
centilitre = 0.01 litre
millilitre = cc
ml = millilitre # millilitre
dekalitre = 10 litre
hectolitre = 100 litre
kilolitre = 1000 litre
kl = kilolitre # kilolitre
megalitre = 1000 kilolitre
gallon = 231 in^3 # # US liquide
gal = gallon # gallon # US liquide
quart = 1/4.0 gallon # # US liquide
qt = quart # litre # US liquide
pint = 1/2.0 quart # # US liquide
pt = pint # pinte # US liquide
once liquide = 1/16.0 pint # # US
fl oz = once liquide # once liquide # US
impérial gallon = 4.54609 litre
imp gal = impérial gallon # gallon impérial
gallon impérial = impérial gallon
impérial quart = 1/4.0 imp gal
imp qt = impérial quart # litre impérial
quart impérial = impérial quart
impérial pint = 1/8.0 imp gal
imp pt = impérial pint # pinte impériale
pint impérial = impérial pint
once liquide impériale = 1/160.0 imp gal
imp fl oz = once liquide impériale # once liquide impériale
tasse = 8 fl oz
cuillier a table = 1/16.0 tasse
c-a-t = cuillier a table # cuillère à table
cuillier a the = 1/3.0 c-a-t
tsp = cuillier a the # cuillère à thé
baril = 42 gallon
bbl = baril # baril
shot = 1.5 fl oz
fifth = 1/5.0 gallon # # alcool
bouteille de vin = 750 ml
magnum = 1.5 litre # # alcool
tonneau = 15.5 gallon # # bière
hogshead wine = 63 gal
hogshead beer = 54 gal
bushel = 2150.42 in^3
peck = 1/4.0 bushel
cord = 128 ft^3
board foot = ft^2*in
board feet = board foot
#
# velocity units
#
[vitesse]
noeud = nmi/hr
kt = noeud # noeud
vitesse lumiere = 2.99792458e8 m/s
mph = mi/hr # milles/heure
kph = km/hr # kilomètres/heure
mach = 340.29 m/s # # mur du son
[vitesse de rotation]
rpm = tour/min # tour/min
rps = tour/sec # tour/sec
#
# flow rate units
#
[flux de fluide]
gph = gal/hr # gallons/heure
gpm = gal/min # gallons/minute
cfs = ft^3/sec # pieds cubes/seconde
cfm = ft^3/min # pieds cubes/minute
lpm = l/min # litre/min
[flux de gaz]
sccm = atm*cc/min # TPN cc/min # pression * flux
sccs = atm*cc/sec # TPN cc/sec # pression * flux
slpm = atm*l/min # TPN litre/min # pression * flux
slph = atm*l/hr # TPN litre/heure # pression * flux
scfh = atm*ft^3/heure # TPN pied cube/heure # pression * flux
scfm = atm*ft^3/min # TPN pied cube/min # pression * flux
#
# pressure units
#
[pression]
Pa = N/m^2 # Pascal
pascal = Pa
hPa = 100 Pa # hectoPascal
hectopascal = hPa
kPa = 1000 Pa # kiloPascal
kilopascal = kPa
MPa = 1000 kPa # megaPascal
megapascal = MPa
GPa = 1000 MPa # gigaPascal
gigapascal = GPa
atm = 101325 Pa # atmosphère
atmosphère = atm
bar = 1e5 Pa
mbar = 0.001 bar # millibar
millibar = mbar
microbar = 0.001 mbar
decibar = 0.1 bar
kilobar = 1000 bar
megabar = 1000 kilobar
mm Hg = mm*densité Hg*acceleration gravitationnelle
millimètre de Hg = mm Hg
torr = mm Hg
in Hg = in*densité Hg*acceleration gravitationnelle # mm de Hg
pouce de Hg = in Hg
m water = m*densité eau*acceleration gravitationnelle # mètre de H2O
m H2O = m water # mètre de H2O
metre de water = m water
in water = in*densité eau*acceleration gravitationnelle # pouce de H2O
in H2O = in water # pouce de H2O
inch of water = in water
ft water = ft*densité eau*acceleration gravitationnelle # pied de H2O
ft H2O = ft water # pied de H20
feet of water = ft water
foot of head = ft water
ft hd = ft water # foot of head
psi = lbf/in^2 # livre / pouce carré
livre par pouce carre = psi
ksi = 1000 psi # 1000 lb / pouce carré
#
# density units
#
[densite]
densité eau = gramme/cm^3
densité eau salee = 1.025 gramme/cm^3
densité Hg = 13.5950981 gramme/cm^3
densité air = 1.293 kg/m^3 # # a TPN
densité acier = 0.283 lb/in^3 # # acier carbone
densité aluminum = 0.098 lb/in^3
densité zinc = 0.230 lb/in^3
densité cuivre-zinc = 0.310 lb/in^3 # # 80Cu-20Zn
densité cuivre = 0.295 lb/in^3
densité fonte = 0.260 lb/in^3 # # fonte
densité nickel = 0.308 lb/in^3
densité tin = 0.275 lb/in^3
densité titane = 0.170 lb/in^3
densité argent = 0.379 lb/in^3
densité nylon = 0.045 lb/in^3
densité polycarbonate = 0.045 lb/in^3
#
# energy units
#
[energie]
joule = N*m
J = joule # joule
kilojoule = 1000 joule
kJ = kilojoule # kilojoule
megajoule = 1000 kilojoule
gigajoule = 1000 megajoule
millijoule = 0.001 joule
mJ = millijoule # millijoule
calorie = 4.1868 J
cal = calorie # calorie
kilocalorie = 1000 cal
kcal = kilocalorie # kilocalorie
calorie food = kilocalorie
thermie = 1000 kcal
Btu = cal*lb*R/(g*K) # British thermal unit
British thermal unit = Btu
therm = 100000 Btu
erg = cm*dyne
electronvolt = 1.602176462e-19 J
eV = electronvolt # electronvolt
kWh = kW*heure # kilowatt-heure
kilowatt heure = kWh
tonne TNT = 4.184e9 J
#
# power units
#
[puissance]
watt = J/s
W = watt # watt
kilowatt = 1000 W
kW = kilowatt # kilowatt
megawatt = 1000 kW
MW = megawatt # megawatt
gigawatt = 1000 MW
GW = gigawatt # gigawatt
milliwatt = 0.001 W
horsepower = 550 ft*lbf/sec
hp = horsepower # chevaux-vapeur
horsepower metrique = 75 kgf*m/s
#
# frequency
#
[frequence]
hertz = unite/sec
Hz = hertz # hertz
millihertz = 0.001 Hz
kilohertz = 1000 Hz
kHz = kilohertz # kilohertz
megahertz = 1000 kHz
MHz = megahertz # megahertz
gigahertz = 1000 MHz
GHz = gigahertz # gigahertz
#
# radioactivity
#
[radioactivite]
becquerel = unite/sec
Bq = becquerel # becquerel
curie = 3.7e10 Bq
millicurie = 0.001 curie
roentgen = 2.58e-4 coulomb/kg
[dose de radiation]
gray = J/kg
Gy = gray # gray
rad. abs. dose = 0.01 Gy # # rad commun
sievert = J/kg # # equiv. dose
millisievert = 0.001 sievert # # equiv. dose
Sv = sievert # sievert # equiv. dose
rem = 0.01 Sv # # roentgen equiv mammal
millirem = 0.001 rem # # roentgen equiv mammal
#
# viscosity
#
[viscosite]
poise = g/cm*s
P = poise # poise
centipoise = 0.01 poise
cP = centipoise # centipoise
[viscosite]
stokes = cm^2/s
St = stokes # stokes
centistokes = 0.01 stokes
cSt = centistokes # centistokes
#
# misc. units
#
[acceleration]
acceleration gravitationnelle = 9.80665 m/s^2
[constante]
constante de gravite = 6.673e-11 N*m^2/kg^2
constante des gaz = 8.314472 J/mol*K # R
[consommation d'essence]
mpg = mi/gal # milles/gallon
mpg imp = mi/gallon impérial # milles/gallon imp.
litre par 100 km = [mpg] 3.785411784 / (x * 0.01609344) ; \
3.785411784 / (x * 0.01609344) # # non linéaire
ConvertAll/data/units_es.dat 0000644 0001750 0001750 00000066761 12273245376 015074 0 ustar doug doug #*****************************************************************************
# units.dat, el archivo de datos de unidad, versión 0.6.0
#
# ConvertAll, un programa para convertir unidades
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, Version 2. This program is
# distributed in the hope that it will be useful, but WITTHOUT ANY WARRANTY.
#*****************************************************************************
#
# Units are defined by an optional quantity and an equivalent unit or unit
# combination. A python expression may be used for the quantity, but is
# resticted to using only the following operators: *, /, +, -, **, (, ).
# Beware of integer division truncation: be sure to use a float for at
# least one of the values.
#
# The unit type must be placed in square brackets before a set of units.
# The first comment after the equivalent unit will be put in parenthesis after
# the unit name (usually used to give the full name of an abbreviated unit).
# The next comment will be used in the program list's comment column;
# later comments and full line comments are ignored.
#
# Non-linear units are indicated with an equivalent unit in square brackets,
# followed by either equations or equivalency lists for the definition.
# For equations, two are given, separated by a ';'. Both are functions of
# "x", the first going from the unit to the equivalent unit and the second
# one in reverse. Any valid Python expression returning a float (including
# the functions in the math module) should work. The equivalency list is a
# python list of tuples giving points for linear interpolation.
#
# All units must reduce to primitive units, which are indicated by an
# equivalent unit starting with '!'. A special "unitless" primitve unit
# (usualty called "unit") has '!!' for an equivalent unit. Circular references
# must also be avoided.
#
# Primitive units: kg, m, s, K, A, mol, cd, rad, sr, bit, unit
#
##############################################################################
#
# unidades de masa
#
[masa]
kg = ! # kilogramo
kilogramo = kg
key = kg # # jerga de drogas
hectogramo = 100 gramo
decagramo = 10 gramo
gramo = 0.001 kg
g = gramo # gramo
decigramo = 0.1 gramo
centigramo = 0.01 gramo
miligramo = 0.001 gramo
mg = miligramo # miligramo
microgramo = 0.001 mg
tonelada = 1000 kg # # métrica
tonelada métrica = tonelada
megagramo = tonelada
kilotonelada = 1000 tonelada # # métrica
gigagramo = 1e9 gramo
teragramo = 1e12 gramo
carat = 0.2 gramo
ct = carat # carat
amu = 1.66053873e-27 kg # masa atómica
unidad de masa atómica = amu
libra = 0.45359237 kg
lb = libra # libra
lbm = libra # libra
onza = 1/16.0 libra
oz = onza # onza
lid = onza # # jerga de drogas
libra troy = 5760 grain
lb troy = libra troy # libra troy
onza troy = 1/12.0 lb troy
oz troy = onza troy # onza troy
ton = 2000 lb # # no métrico
kilotón = 1000 ton # # no métrico
slug = lbf*s^2/ft
stone = 14 lb
grain = 1/7000.0 lb
pennyweight = 24 grain
hundredweight long = 112 lb # # Imperial
hundredweight short = 100 lb # # US & Canadá
masa solar = 1.9891e30 kg
#
# unidades de longitud / distancia
#
[longitud]
m = ! # metro
metro = m
metre = m
decímetro = 0.1 m
cm = 0.01 m # centímetro
centímetro = cm
mm = 0.001 m # milímetro
milímetro = mm
micrómetro = 1e-6 m
micrón = micrómetro
nanómetro = 1e-9 m
nm = nanómetro # nanómetro
decámetro = 10 m
hectómetro = 100 m
km = 1000 m # kilómetro
kilómetro = km
megámetro = 1000 km
angstrom = 1e-10 m
fermi = 1e-15 m # # tamaño nuclear
pulgada = 2.54 cm
in = pulgada # pulgada
pulgadas = pulgada
mil = 0.001 pulgada
micropulgada = 1e-6 pulgada
micropulgadas = micropulgada
pie = 12 pulgada
ft = pie # pie
pies = pie
pie US survey = 1200/3937.0 m
yarda = 3 ft
yd = yarda # yarda
milla = 5280 ft
mi = milla # milla
milla náutica = 1852 m
nmi = milla náutica # milla náutica
legua = 3 milla
chain = 66 ft
braza = 6 ft
rod = 5.5 yarda
furlong = 40 rod
estadio = furlong
mano = 4 pulgada
codo = 21.8 pulgada # # unidad bíblica
point = 1/72.0 pulgada # # punto de carácter tipográfico
pica = 12 point
calibre = 0.01 pulgada # # tamaño de una bala
football field = 100 yd
marathon = 46145 yd
milla escandinava = 10 km
au = 1.49597870691e11 m # unidad astronómica
unidad astronómica = au
año luz = 365.25 velocidad de la luz * día
minuto luz = velocidad de la luz * min
segundo luz = velocidad de la luz * s
parsec = 3.0856775813e16 m
kiloparsec = 1000 parsec
megaparsec = 1000 kiloparsec
screw size = [in] 0.013*x + 0.06 ; (x - 0.06) / 0.013 \
# # Diámetro unificado, no linear
AWG Dia = [in] 92.0**((36-x)/39.0)/200.0 ; \
36 - 39.0*log(200.0*x)/log(92.0) \
# American Wire Gauge \
# use -1, -2 for 00, 000; non-linear
American Wire Gauge Dia = [in] 92.0**((36-x)/39.0)/200.0 ; \
36 - 39.0*log(200.0*x)/log(92.0) \
# # use -1, -2 for 00, 000; non-linear
standard gauge = [in] [(-5, .448350), (1, .269010), (14, .0747250), \
(16, .0597800), (17, .0538020), (20, .0358680), \
(26, .0179340), (31, .0104615), (36, .00672525), \
(38, .00597800)] # steel \
# Manufacturers Std. Gauge, non-linear
zinc gauge = [in] [(1, .002), (10, .02), (15, .04), (19, .06), \
(23, .1), (24, .125), (27, .5), (28, 1)] \
# # sheet metal thickness, non-linear
ring size = [in] 0.1018*x + 1.4216 ; (x - 1.4216) / 0.1018 \
# # US size, circum., non-linear
tamaño de zapato para hombres = [in] x/3.0 + 7 + 1/3.0 ; (x - 7 - 1/3.0) * 3 \
# # medida US, no linear
tamaño de zapato para mujeres = [in] x/3.0 + 6 + 5/6.0 ; (x - 6 - 5/6.0) * 3 \
# # medida US, no linear
#
# unidades de tiempo
#
[tiempo]
s = ! # segundo
seg = s # segundo
segundo = s
ms = 0.001 s # milisegundo
milisegundo = ms
microsegundo = 1e-6 s
ns = 1e-9 s # nanosegundo
nanosegundo = ns
minuto = 60 s
min = minuto # minuto
hora = 60 min
hr = hora # hora
bell = 30 min # # definición naval
watch = 4 hora
watches = watch
día = 24 hr
semana = 7 día
wk = semana # semana
fortnight = 14 días
mes = 1/12.0 año
año = 365.242198781 día
años = año
yr = año # año
año calendario = 365 día
década = 10 año
siglo = 100 año
siglos = siglo
milenio = 1000 año
milenios = milenio
[planificación]
horas hombre = 168/40.0 hora
semanas hombre = 40 horas hombre
meses hombre = 1/12.0 años hombre
años hombre = 52 semanas hombre
#
# temperatura
#
[temperatura]
K = ! # Kelvin
Kelvin = K
deg K = K # Kelvin
grado Kelvin = K
C = [K] x + 273.15 ; x - 273.15 # Celsius # no linear
Celsius = [K] x + 273.15 ; x - 273.15 # # no linear
deg C = [K] x + 273.15 ; x - 273.15 # Celsius # no linear
grado Celsius = [K] x + 273.15 ; x - 273.15 # # no linear
R = 5/9.0 K # Rankine
Rankine = R
deg R = R # Rankine
F = [R] x + 459.67 ; x - 459.67 # Fahrenheit # no linear
Fahrenheit = [R] x + 459.67 ; x - 459.67 # # no linear
deg F = [R] x + 459.67 ; x - 459.67 # Fahrenheit # no linear
grado Fahrenheit = [R] x + 459.67 ; x - 459.67 # # no linear
[temp. diff.]
C deg = K # grados Celsius
grados Celsius = C deg
F deg = R # grados Fahrenheit
grados Fahrenheit = F deg
#
# unidades eléctricas
#
[corriente]
A = ! # ampere
ampere = A
amp = A
amperio = A
miliamperio = 0.001 A
miliamp = miliamperio
mA = miliamperio # miliamperio
microamperio = 0.001 mA
kiloamperio = 1000 A
kA = kiloamperio # kiloamperio
[carga]
coulomb = A*s
amp hora = A*hr
mAh = 0.001 amp hora # miliamp hora
miliamp hora = mAh
[potencial]
voltio = W/A
V = voltio # voltio
milivoltio = 0.001 voltio
mV = milivoltio # milivoltio
kilovoltio = 1000 voltio
kV = kilovoltio # kilovoltio
[resistencia]
ohm = V/A
miliohm = 0.001 ohm
microhm = 0.001 miliohm
kilohm = 1000 ohm
[conductancia]
siemens = A/V
[capacitancia]
farad = coulomb/V
milifarad = 0.001 farad
microfarad = 0.001 milifarad
nanofarad = 1e-9 farad
picofarad = 1e-12 farad
[flujo magnético]
weber = V*s
Wb = weber # weber
maxwell = 1e-8 Wb
[inductancia]
henry = Wb/A
H = henry # henry
milihenry = 0.001 henry
mH = milihenry # milihenry
microhenry = 0.001 mH
[densidad de flujo]
tesla = Wb/m^2
T = tesla # tesla
gauss = maxwell/cm^2
#
# unidades moleculares
#
[cantidades moleculares]
mol = ! # mole # gramo mole
mole = mol # # gramo mole
gramo mole = mol
kilomol = 1000 mol
kmol = kilomol # kilomol
libra mole = mol*lbm/gramo
lbmol = libra mole # libra mole
[tamaño de un mol]
avogadro = gramo/(amu*mol)
#
# Unidades de iluminación
#
[intensidad de iluminación]
cd = ! # candela
candela = cd
[flujo luminoso]
lumen = cd * sr
lm = lumen # lumen
[iluminancia]
lux = lumen/m^2
footcandle = lumen/ft^2
metercandle = lumen/m^2
[luminancia]
lambert = cd/(pi*cm^2)
mililambert = 0.001 lambert
footlambert = cd/(pi*ft^2)
#
# unidades angulares
#
[ángulo]
radián = !
rad = radián # radián
círculo = 2 pi*radián
giro = círculo
revolución = círculo
rev = revolución # revolución
grado = 1/360.0 círculo
deg = grado # grado
arc min = 1/60.0 grado # minuto
arc minute = arc min
min arc = arc min # minuto
minute arc = arc min
arc seg = 1/60.0 arc min # segundo
arc segundo = arc seg
seg arc = arc seg # segundo
segundo arc = arc seg
cuadrante = 1/4.0 círculo
ángulo recto = cuadrante
gradián = 0.01 cuadrante
#
# unidades de ángulo sólido
#
[ángulo sólido]
sr = ! # estereorradián
estereorradián = sr
esfera = 4 pi*sr
hemiesfera = 1/2.0 esfera
#
# unidades de información
#
[datos]
bit = !
kilobit = 1000 bit # # basado en potencias de 10
megabit = 1000 kilobit # # basado en potencias de 10
byte = 8 bit
B = byte # byte
kilobyte = 1024 byte # # basado en potencias de 2
kB = kilobyte # kilobyte # basado en potencias de 2
megabyte = 1024 kB # # basado en potencias de 2
MB = megabyte # megabyte # basado en potencias de 2
gigabyte = 1024 MB # # basado en potencias de 2
GB = gigabyte # gigabyte # basado en potencias de 2
terabyte = 1024 GB # # basado en potencias de 2
TB = terabyte # terabyte # basado en potencias de 2
petabyte = 1024 TB # # basado en potencias de 2
PB = petabyte # petabyte # basado en potencias de 2
kilobyte IEC std = 1000 byte # # basado en potencias de 10
kB IEC std = kilobyte IEC std # kilobyte # basado en potencias de 10
megabyte IEC std = 1000 kB IEC std # # basado en potencias de 10
MB IEC std = megabyte IEC std # megabyte # basado en potencias de 10
gigabyte IEC std = 1000 MB IEC std # # basado en potencias de 10
GB IEC std = gigabyte IEC std # gigabyte # basado en potencias de 10
terabyte IEC std = 1000 GB IEC std # # basado en potencias de 10
TB IEC std = terabyte IEC std # terabyte # basado en potencias de 10
petabyte IEC std = 1000 TB IEC std # # basado en potencias de 10
PB IEC std = petabyte IEC std # petabyte # basado en potencias de 10
kibibyte = 1024 byte
KiB = kibibyte # kibibyte
mebibyte = 1024 KiB
MiB = mebibyte # mebibyte
gibibyte = 1024 MiB
GiB = gibibyte # gibibyte
tebibyte = 1024 GiB
TiB = tebibyte # tebibyte
pebibyte = 1024 TiB
PiB = pebibyte # pebibyte
[transferencia de datos]
bps = bit/seg # bits / segundo
kbps = 1000 bps # kilobits / sec. # basado en potencias de 10
#
# Números sin unidades
#
[cantidad]
unidad = !!
1 = unidad # unidad
pi = 3.14159265358979323846 unidad
par = 2 unidad
hat trick = 3 unidad # # deportes
docena = 12 unidad
doz = docena # docena
bakers dozen = 13 unidad
score = 20 unidad
gross = 144 unidad
great gross = 12 gross
ream = 500 unidad
porciento = 0.01 unidad
% = porciento
mill = 0.001 unidad
[tasa de interés]
APR = [unidad] log(1 + x/100) ; (exp(x) - 1)*100 \
# annual % rate # based on continuous compounding
[concentración]
proof = 1/200.0 unidad # # contenido alcohólico
ppm = 1e-6 unidad # partes por millón
partes por millón = ppm
ppb = 1e-9 unidad # partes por billón (US: en realidad es millardo)
partes por billón = ppb
ppt = 1e-12 unidad # partes por trillón (US: en realidad es billón)
partes por trillón = ppt
karat = 1/24.0 unidad # # pureza del oro
carat oro = karat # # pureza del oro
#
# unidades de fuerza
#
[fuerza]
newton = kg*m/s^2
N = newton # newton
decanewton = 10 newton
kilonewton = 1000 N
kN = kilonewton # kilonewton
meganewton = 1000 kN
milinewton = 0.001 N
dyna = cm*g/s^2
kg fuerza = kg * gravedad # kilogramo f
kgf = kg fuerza # kilogramo fuerza
kilogramo fuerza = kg fuerza
gramo fuerza = g * gravedad
libra fuerza = lbm * gravedad
lbf = libra fuerza # libra fuerza
ton fuerza = ton * gravedad
onza fuerza = onza * gravedad
ozf = onza fuerza # onza fuerza
tonelada fuerza = tonelada * gravedad # # métrica
#
# unidades de área
#
[área]
barn = 1e-28 m^2 # # física de partículas
área = 100 m^2
decaárea = 10 área
dekare = 10 área
hectárea = 100 área
acre = 10 chain^2
section = milla^2
township = 36 section
homestead = 160 acre
rai = 1600 m^2 # # Thai
ngaan = 400 m^2 # # Thai
pulgada circular = 1/4.0 pi*in^2 # # área de un círculo de 1 pulgada de diámetro
milla circular = 1/4.0 pi*mil^2 # # área de un círculo de 1 milla de diámetro
AWG Area = [in^2] pi/4*(92.0**((36-x)/39.0)/200.0)**2 ; \
sqrt(36 - 39.0*log(200.0*x)/log(92.0))*4/pi \
# American Wire Gauge \
# use -1, -2 for 00, 000; non-linear
American Wire Gauge Area = [in^2] pi/4*(92.0**((36-x)/39.0)/200.0)**2 ; \
sqrt(36 - 39.0*log(200.0*x)/log(92.0))*4/pi \
# # use -1, -2 for 00, 000; non-linear
#
# unidades de volumen
#
[volumen]
cc = cm^3 # centímetro cúbico
centímetro cúbico = cc
litro = 1000 cc
l = litro # litro
litros = litro
decilitro = 0.1 litro
centilitro = 0.01 litro
mililitro = cc
ml = mililitro # mililitro
decalitro = 10 litro
hectolitro = 100 litro
kilolitro = 1000 litro
kl = kilolitro # kilolitro
megalitro = 1000 kilolitro
galón = 231 in^3 # # líquidos en US
gal = galón # galón # líquidos en US
quart = 1/4.0 galón # # líquidos en US
qt = quart # quart # líquidos en US
pint = 1/2.0 quart # # líquidos en US
pt = pint # pint # líquidos en US
onza líquida = 1/16.0 pint # # US
fl oz = onza líquida # onza líquida # US
galón imperial = 4.54609 litro
imp gal = galón imperial # galón imperial
imperial galón = galón imperial
cuarto imperial = 1/4.0 imp gal
imp qt = cuarto imperial # cuarto imperial
imperial cuarto = cuarto imperial
imperial pinta = 1/8.0 imp gal
imp pt = imperial pinta # pinta imperial
pinta imperial = imperial pinta
onza líquida imperial = 1/160.0 imp gal
imp fl oz = onza líquida imperial # onza líquida imperial
taza = 8 fl oz
cuchara de mesa = 1/16.0 taza
tbsp = cuchara de mesa # cuchara de mesa
cuchara de té = 1/3.0 tbsp
tsp = cuchara de té # cuchara de té
barril = 42 galón
bbl = barril # barril
shot = 1.5 fl oz
fifth = 1/5.0 galón # # alcohol
botella de vino = 750 ml
magnum = 1.5 litro # # alcohol
keg = 15.5 galón # # cerveza
hogshead wine = 63 gal
hogshead beer = 54 gal
bushel = 2150.42 in^3
peck = 1/4.0 bushel
cord = 128 ft^3
board foot = ft^2*in
board feet = board foot
#
# unidades de velocidad
#
[velocidad]
nudo = nmi/hr
kt = nudo # nudo
velocidad de la luz = 2.99792458e8 m/s
mph = mi/hr # millas/hora
kph = km/hr # kilómetros/hora
mach = 340.29 m/s # # velocidad del sonido a STP
[velocidad de rotación]
rpm = rev/min # rev/min
rps = rev/seg # rev/seg
#
# unidades de flujo
#
[unidades de flujo]
gph = gal/hr # galón/hora
gpm = gal/min # galón/minuto
cfs = ft^3/seg # cu ft/segundo
cfm = ft^3/min # cu ft/minuto
lpm = l/min # litro/min
[flujo de gas]
sccm = atm*cc/min # std cc/min # presión * flujo
sccs = atm*cc/seg # std cc/seg # presión * flujo
slpm = atm*l/min # std litro/min # presión * flujo
slph = atm*l/hr # std litro/hora # presión * flujo
scfh = atm*ft^3/hora # std cu ft/hora # presión * flujo
scfm = atm*ft^3/min # std cu ft/min # presión * flujo
#
# unidades de presión
#
[presión]
Pa = N/m^2 # pascal
pascal = Pa
hPa = 100 Pa # hectopascal
hectopascal = hPa
kPa = 1000 Pa # kilopascal
kilopascal = kPa
MPa = 1000 kPa # megapascal
megapascal = MPa
GPa = 1000 MPa # gigapascal
gigapascal = GPa
atm = 101325 Pa # atmósfera
atmósfera = atm
bar = 1e5 Pa
mbar = 0.001 bar # milibar
milibar = mbar
microbar = 0.001 mbar
decibar = 0.1 bar
kilobar = 1000 bar
megabar = 1000 kilobar
mm Hg = mm*densidad Hg*gravedad
milímetro de Hg = mm Hg
torr = mm Hg
in Hg = in*densidad Hg*gravedad # pulgadas de Hg
pulgadas de Hg = in Hg
m agua = m*densidad agua*gravedad # metros de H2O
m H2O = m agua # metros de H2O
metros de agua = m agua
in de agua = in*densidad agua*gravedad # pulgadas de H2O
in H2O = in de agua # pulgadas de H2O
pulgadas de agua = in de agua
ft de agua = ft*densidad agua*gravedad # pies de H2O
ft H2O = ft de agua # pies de H20
pies de agua = ft de agua
pies de head = ft de agua
ft hd = ft de agua # pies de head
psi = lbf/in^2 # libra / pulgada cuadrada
libra por pulgada cuadrada = psi
ksi = 1000 psi # 1000 lb / pulgada cuadrada
#
# unidades de densidad
#
[densidad]
densidad agua = gramo/cm^3
densidad agua de mar = 1.025 gramo/cm^3
densidad Hg = 13.5950981 gramo/cm^3
densidad aire = 1.293 kg/m^3 # # a STP
densidad acero = 0.283 lb/in^3 # # acero al carbón
densidad aluminio = 0.098 lb/in^3
densidad zinc = 0.230 lb/in^3
densidad bronce = 0.310 lb/in^3 # # 80Cu-20Zn
densidad cobre = 0.295 lb/in^3
densidad hierro = 0.260 lb/in^3 # # hierro colado
densidad nickel = 0.308 lb/in^3
densidad estaño = 0.275 lb/in^3
densidad titanio = 0.170 lb/in^3
densidad plata = 0.379 lb/in^3
densidad nylon = 0.045 lb/in^3
densidad polycarbonato = 0.045 lb/in^3
#
# unidades de energía
#
[energía]
joule = N*m
J = joule # joule
kilojoule = 1000 joule
kJ = kilojoule # kilojoule
megajoule = 1000 kilojoule
gigajoule = 1000 megajoule
milijoule = 0.001 joule
mJ = milijoule # milijoule
caloría = 4.1868 J
cal = caloría # caloría
kilocaloría = 1000 cal
kcal = kilocaloría # kilocaloría
caloría comida = kilocaloría
thermie = 1000 kcal
Btu = cal*lb*R/(g*K) # British thermal unit
British thermal unit = Btu
therm = 100000 Btu
erg = cm*dyna
electronvolt = 1.602176462e-19 J
eV = electronvolt # electronvolt
kWh = kW*hora # kilowatt-hora
kilowatt hora = kWh
ton TNT = 4.184e9 J
tonelada de aceite equivalente = 41.868 gigajoule
tonelada de carbón equivalente = 7000000 kcal
#
# unidades de potencia
#
[potencia]
watt = J/s
W = watt # watt
kilowatt = 1000 W
kW = kilowatt # kilowatt
megawatt = 1000 kW
MW = megawatt # megawatt
gigawatt = 1000 MW
GW = gigawatt # gigawatt
miliwatt = 0.001 W
caballo de fuerza = 550 ft*lbf/seg
caballo de potencia = caballo de fuerza
hp = caballo de fuerza # caballo de fuerza
caballo de fuerza métrico = 75 kgf*m/s
ton refrigeración = 12000 Btu/hr
#
# frecuencia
#
[frecuencia]
hertz = unidad/seg
Hz = hertz # hertz
milihertz = 0.001 Hz
kilohertz = 1000 Hz
kHz = kilohertz # kilohertz
megahertz = 1000 kHz
MHz = megahertz # megahertz
gigahertz = 1000 MHz
GHz = gigahertz # gigahertz
#
# radioactividad
#
[radioactividad]
becquerel = unidad/seg
Bq = becquerel # becquerel
curie = 3.7e10 Bq
milicurie = 0.001 curie
roentgen = 2.58e-4 coulomb/kg
[dosis de radiación]
gray = J/kg
Gy = gray # gray
rad. abs. dose = 0.01 Gy # # comúnmente rad
sievert = J/kg # # dosis equivalente
milisievert = 0.001 sievert # # dosis equivalente
Sv = sievert # sievert # dosis equivalente
rem = 0.01 Sv # # roentgen equiv mamífero
milirem = 0.001 rem # # roentgen equiv mamífero
#
# viscosidad
#
[viscosidad dinámica]
poise = g/(cm*s)
P = poise # poise
centipoise = 0.01 poise
cP = centipoise # centipoise
[viscosidad cinemática]
stokes = cm^2/s
St = stokes # stokes
centistokes = 0.01 stokes
cSt = centistokes # centistokes
#
# unidades misceláneas
#
[aceleración]
gravedad = 9.80665 m/s^2
[constante]
constante gravitacional = 6.673e-11 N*m^2/kg^2
constante de los gases = 8.314472 J/(mol*K) # R
[consumo de combustible]
mpg = mi/gal # millas/galón
mpg imp = mi/galón imperial # millas/galón imp
litro por 100 km = [mpg] 3.785411784 / (x * 0.01609344) ; \
3.785411784 / (x * 0.01609344) # # non-linear
[permeabilidad]
darcy = 1 cm^2*centipoise/atm/s
milidarcy = 0.001 darcy
ConvertAll/data/units_de.dat 0000644 0001750 0001750 00000102532 12273245376 015040 0 ustar doug doug #*****************************************************************************
# units.dat, the units data file, version 0.6.0
#
# ConvertAll, a units conversion program
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, Version 2. This program is
# distributed in the hope that it will be useful, but WITTHOUT ANY WARRANTY.
#*****************************************************************************
#
# Units are defined by an optional quantity and an equivalent unit or unit
# combination. A python expression may be used for the quantity, but is
# resticted to using only the following operators: *, /, +, -, **, (, ).
# Beware of integer division truncation: be sure to use a float for at
# least one of the values.
#
# The unit type must be placed in square brackets before a set of units.
# The first comment after the equivalent unit will be put in parenthesis after
# the unit name (usually used to give the full name of an abbreviated unit).
# The next comment will be used in the program list's comment column;
# later comments and full line comments are ignored.
#
# Non-linear units are indicated with an equivalent unit in square brackets,
# followed by either equations or equivalency lists for the definition.
# For equations, two are given, separated by a ';'. Both are functions of
# "x", the first going from the unit to the equivalent unit and the second
# one in reverse. Any valid Python expression returning a float (including
# the functions in the math module) should work. The equivalency list is a
# python list of tuples giving points for linear interpolation.
#
# All units must reduce to primitive units, which are indicated by an
# equivalent unit starting with '!'. A special "unitless" primitve unit
# (usualty called "unit") has '!!' for an equivalent unit. Circular references
# must also be avoided.
#
# Primitive units: kg, m, s, K, A, mol, cd, rad, sr, bit, unit
#
##############################################################################
#
# mass units
#
[Masse]
kg = ! # Kilogramm
Kilogramm = kg
Hektogramm = 100 Gramm
Dekagramm = 10 Gramm
Gramm = 0.001 kg
g = Gramm # Gramm
Dezigramm = 0.1 Gramm
Zentigramm = 0.01 Gramm
Milligramm = 0.001 Gramm
mg = Milligramm # Milligramm
Mikrogramm = 0.001 mg
µg = Mikrogramm # Mikrogramm
t = 1000 kg # Tonne # metrisch
Tonne = t
Metrische Tonne = t
Megagramm = t
Kilotonne = 1000 t # # metrisch
Gigagramm = 1e9 g
Teragramm = 1e12 g
Karat = 0.2 g # # Gewichtsmaß für Edelsteine
ct = Karat # Karat # engl. carat
amu = 1.66053873e-27 kg # Atomare Masseneinheit
atomare Masseneinheit = amu
Pfund deutsch = 500 g # # dt. Sprachraum, ugs.
pound = 0.45359237 kg # # angloamer. Pfund
Pfund = pound # # angloamer. Pfund
lb = pound # Pfund # engl. pound
lbm = pound # Pfund # engl. pound
ounce = 1/16.0 pound # Unze
Unze = ounce # # engl. ounce
oz = ounce # Unze # engl. ounce
lid = ounce # Unze # Drogenslang
pound troy = 5760 grain # # angloamer. Apotheker-Pfund
lb troy = pound troy # # angloamer. Apotheker-Pfund
ounce troy = 1/12.0 lb troy # Feinunze # angloamer. Apotheker-Unze
oz troy = ounce troy # Feinunze # angloamer. Apotheker-Unze
Feinunze = ounce troy # # Gewichtseinheit für Goldhandel
ton = 2000 lb # nicht-metrisch # angloamer. Tonne
kiloton = 1000 ton # nicht-metrisch # angloamer. Tonne
slug = lbf*s^2/ft
hyl = kp*s^2/m # # seit 1978 untersagt
stone = 14 lb
grain = 1/7000.0 lb
pennyweight = 24 grain
hundredweight long = 112 lb # # britisches Maß
hundredweight short = 100 lb
Erdmasse = 5.974e24 kg
Mondmasse = 7.349e22 kg
Sonnenmasse = 1.9891e30 kg
#
# length / distance units
#
[Länge]
m = ! # Meter
Meter = m
metre = m
Dezimeter = 0.1 m
dm = Dezimeter # Dezimeter
Zentimeter = 0.01 m
cm = Zentimeter # Zentimeter
Millimeter = 0.001 m
mm = Millimeter # Millimeter
Mikrometer = 1e-6 m
Mikron = Mikrometer
µm = Mikrometer # Mikrometer
Nanometer = 1e-9 m
nm = Nanometer # Nanometer
Dekameter = 10 m
Hektometer = 100 m
Kilometer = 1000 m
km = Kilometer # Kilometer
Megameter = 1000 km
Ångström = 1e-10 m
Angström = Ångström
Å = Angström # Ångström
fm = 1e-15 m # Femtometer
Fermi = fm # # Kerngrößen, veraltet
Zoll = 2.54 cm
in = Zoll # Zoll # engl. inch
inch = Zoll
inches = inch
mil US = 0.001 inch # # angloamer. Millizoll
Mikrozoll = 1e-6 Zoll
microinch = Mikrozoll
Fuß = 12 Zoll
foot = Fuß # Fuß
ft = foot # Fuß # engl. foot
feet = foot # Fuß
foot US survey = 1200/3937.0 m
yard = 3 ft # # engl. Schritt
yd = yard # Yard # engl. Schritt
Schritt = yard
Meile = 5280 ft
mile = Meile # Meile # brit. Landmeile
mi = Meile # Meile # brit. Landmeile
Nautische Meile = 1852 m
nmi = Nautische Meile # nautische Meile
league = 3 mile # # engl. Wegstunde / Landleug
Wegstunde = league
chain = 66 ft # # Kette(nlänge)
fathom = 6 ft # # nautischer Faden
Faden = fathom # # nautischer Faden
rod = 5.5 yard # # Rute
furlong = 40 rod # # Furchenlänge (angloamer.)
hand = 4 inch # # angloamer. Höhenmaß für Pferde
cubit = 21.8 inch # # biblische Einheit
point = 1/72.0 inch # # Punkt im Desktop Publishing
pica = 12 point
Kaliber = 0.01 inch # # Geschossdurchmesser
caliber = Kaliber # # Geschossdurchmesser
Footballfeld = 100 yd # # amer. Football
Marathondistanz = 46145 yd
mil = 10 km # # Metrische/Skandinav. Meile
au = 1.49597870691e11 m # Astronomische Einheit
Astronomische Einheit = au
Lichtjahr = 365.25 Tage * Lichtgeschwindigkeit
Lichtminute = Lichtgeschwindigkeit * min
Lichtsekunde = Lichtgeschwindigkeit * s
Parsec = 3.0856775813e16 m
pc = Parsec # Parsec
Kiloparsec = 1000 Parsec
Megaparsec = 1000 Kiloparsec
Schraubenmaß = [in] 0.013*x + 0.06 ; (x - 0.06) / 0.013 \
# zöllig # Vereinheitlichte Durchmesser, nicht-linear
AWG Dia = [in] 92.0**((36-x)/39.0)/200.0 ; \
36 - 39.0*log(200.0*x)/log(92.0) \
# American Wire Gauge \
# US-Maß für Drahtdurchmesser; -1, -2 für 00, 000 benutzen; nicht-linear
American Wire Gauge Dia = [in] 92.0**((36-x)/39.0)/200.0 ; \
36 - 39.0*log(200.0*x)/log(92.0) \
# # US-Maß für Drahtdurchmesser; -1, -2 für 00, 000 benutzen; nicht-linear
Standard gauge = [in] [(-5, .448350), (1, .269010), (14, .0747250), \
(16, .0597800), (17, .0538020), (20, .0358680), \
(26, .0179340), (31, .0104615), (36, .00672525), \
(38, .00597800)] # Stahl \
# US-Maß für Dicke von Stahlblechen, nicht-linear
Zinc gauge = [in] [(1, .002), (10, .02), (15, .04), (19, .06), \
(23, .1), (24, .125), (27, .5), (28, 1)] \
# # US-Maß für Dicke von Zinkblechen, nicht-linear
Ringgröße US = [in] 0.1018*x + 1.4216 ; (x - 1.4216) / 0.1018 \
# # Umfang, nicht-linear
Schuhgrößen Männer US = [in] x/3.0 + 7 + 1/3.0 ; (x - 7 - 1/3.0) * 3 \
# # US-Größen, nicht-linear
Schuhgrößen Frauen US = [in] x/3.0 + 6 + 5/6.0 ; (x - 6 - 5/6.0) * 3 \
# # US-Größen, nicht-linear
Schuhgrößen EU = [cm] (x * 2.0 / 3.0) - 1.5 ; (x + 1.5) * 3.0 / 2.0 \
# # Innenmaß, nicht-linear
#
# time units
#
[Zeit]
s = ! # Sekunde
sec = s # Sekunde
Sekunde = s
Sekunden = Sekunde
ms = 0.001 s # Millisekunde
Millisekunde = ms
Mikrosekunde = 1e-6 s
µs = Mikrosekunde # Mikrosekunde
ns = 1e-9 s # Nanosekunde
Nanosekunde = ns
Minute = 60 s
min = Minute # Minute
Stunde = 60 min
Stunden = Stunde
Std = Stunde # Stunde
hr = Stunde # Stunde # (lat. hora)
Glasen = 30 min # # Schifffahrt
Glasenschläge = Glasen # # Schifffahrt
Wache = 4 hr # # Schifffahrt
Wachen = 4 hr # # Schifffahrt
Tag = 24 hr
Tage = Tag
d = Tag # Tag # (lat. dies)
Woche = 7 Tage
Wochen = Woche
fortnight = 14 Tage # 14 Tage # (engl.)
Monat = 1/12.0 Jahr
Jahr = 365.242198781 Tage
Jahre = Jahr
y = Jahr # Jahr # (engl. year)
yr = Jahr # Jahr # (engl. year)
Kalenderjahr = 365 Tage
Dekade = 10 Jahre
Jahrzehnt = Dekade
Jahrzehnte = Dekade
Dezennium = Dekade
Jahrhundert = 100 Jahre
Centennium = Jahrhundert
Hektode = Jahrhundert
Jahrhunderte = Jahrhundert
Millennium = 1000 Jahre
Millennia = Millennium
[Zeitplanung]
Personenstunde = 168/40.0 Stunden # # auf 40-Std.-Wochen gerechnet
Personenstunden = Personenstunde
Mannstunde = Personenstunde # # veraltet für "Personenstunde"
Mannstunden = Personenstunde # # veraltet für "Personenstunden"
Personentag = 8 Personenstunden
Personentage = Personentag
Manntag = Personentag # # veraltet für "Personentag"
Manntage = Personentag # # veraltet für "Personentage"
Personenwoche = 5 Personentage
Personenwochen = Personenwoche
Mannwoche = Personenwoche # # veraltet für "Personenwoche"
Mannwochen = Personenwoche # # veraltet für "Personenwochen"
Personenmonat = 20 Personentage
Personenmonate = Personenmonat
Mannmonat = Personenmonat # # veraltet für "Personenmonat"
Mannmonate = Personenmonat # # veraltet für "Personenmonate"
Personenjahr = 2000 Personenstunden
Personenjahre = Personenjahr
Mannjahr = Personenjahr # # veraltet für "Personenjahr"
Mannjahre = Personenjahr # # veraltet für "Personenjahre"
#
# temperature
#
[Temperatur]
K = ! # Kelvin
Kelvin = K
°K = K # Kelvin
Grad Kelvin = K
C = [K] x + 273.15 ; x - 273.15 # Celsius # nicht-linear
Celsius = [K] x + 273.15 ; x - 273.15 # # nicht-linear
°C = [K] x + 273.15 ; x - 273.15 # Celsius # nicht-linear
Grad Celsius = [K] x + 273.15 ; x - 273.15 # # nicht-linear
R = 5/9.0 K # Rankine
Rankine = R
°R = R # Rankine
F = [R] x + 459.67 ; x - 459.67 # Fahrenheit # nicht-linear
Fahrenheit = [R] x + 459.67 ; x - 459.67 # # nicht-linear
°F = [R] x + 459.67 ; x - 459.67 # Fahrenheit # nicht-linear
Grad Fahrenheit = [R] x + 459.67 ; x - 459.67 # # nicht-linear
[Temperaturdifferenz]
C Grad = K # Grad Celsius
Celsius Grad = C Grad
F Grad = R # Grad Fahrenheit
Fahrenheit Grad = F Grad
#
# electrical units
#
[Strom]
A = ! # Ampere
Ampere = A
Milliampere = 0.001 A
mA = Milliampere # Milliampere
Mikroampere = 0.001 mA
Kiloampere = 1000 A
kA = Kiloampere # Kiloampere
[Ladung]
Coulomb = A*s
Amperestunde = A*hr
Amperestunden = Amperestunde
mAh = 0.001 Amperestunde # Milliamperestunde
Milliamp hr = mAh
[Spannung]
Volt = W/A
V = Volt # Volt
Millivolt = 0.001 Volt
mV = Millivolt # Millivolt
Kilovolt = 1000 Volt
kV = Kilovolt # Kilovolt
[Widerstand]
Ohm = V/A
Ω = Ohm # Ohm
Milliohm = 0.001 ohm
Mikroohm = 0.001 Milliohm
Kiloohm = 1000 ohm
[Leitfähigkeit]
Siemens = A/V
℧ = Siemens # Mho # veraltet für Siemens ("Ohm" rückwärts)
[Kapazität]
Farad = Coulomb/V
Millifarad = 0.001 Farad
Mikrofarad = 0.001 Millifarad
Nanofarad = 1e-9 Farad
Pikofarad = 1e-12 Farad
[Magn. Fluss]
Weber = V*s
Wb = Weber # Weber
Maxwell = 1e-8 Wb
[Induktivität]
Henry = Wb/A
H = Henry # Henry
Millihenry = 0.001 Henry
mH = Millihenry # Millihenry
Mikrohenry = 0.001 mH
[Flussdichte]
Tesla = Wb/m^2
# T = Tesla # Tesla ### t = metric ton!
Gauss = Maxwell/cm^2
Gauß = Gauss
#
# molecular units
#
[Molekulare Mengen]
mol = ! # Mol
Kilomol = 1000 mol
kmol = Kilomol # Kilomol
pound mole = mol*lbm/gramm # Pfund Mol # engl.
lbmol = pound mole # Pfund Mol # engl. pound mole
[Größe eines Mol]
Avogadrozahl = Gramm/(amu*mol)
#
# Illumination units
#
[Lichtstärke]
cd = ! # Candela
Candela = cd
[Lichtstrom]
Lumen = cd * sr
lm = Lumen # Lumen
[Beleuchtungsstärke]
lx = Lumen/m^2 # Lux
Lux = lx
footcandle = Lumen/ft^2
metercandle = lx
[Leuchtdichte]
Lambert = cd/(pi*cm^2) # # US-Maß
la = Lambert # Lambert
Millilambert = 0.001 Lambert
footlambert = cd/(pi*ft^2) # # Fuß-Lambert (angloamer.)
#
# angular units
#
[Winkel]
Radian = !
rad = Radian # Radian # Bogengrad
Kreis = 2 pi*rad
Umdrehung = Kreis
rev = Umdrehung # Umdrehung # engl. revolution
Grad = 1/360.0 Kreis
degree = Grad # Grad # engl.
deg = degree # Grad # engl. degree
Bogenminute = 1/60.0 Grad
arc min = Bogenminute # Bogenminute # engl. arc minute
arc minute = Bogenminute # Bogenminute # engl. arc minute
min arc = Bogenminute # Bogenminute # engl. minute arc
minute arc = Bogenminute # Bogenminute
Bogensekunde = 1/60.0 Bogenminute
arc sec = Bogensekunde # Bogensekunde # engl. arc second
arc second = Bogensekunde # Bogensekunde
sec arc = Bogensekunde # Bogensekunde # engl. second arc
second arc = Bogensekunde # Bogensekunde
Halbkreis = 1/2.0 Kreis
Viertelkreis = 1/4.0 Kreis
Quadrant = Viertelkreis
rechter Winkel = Viertelkreis
gon = 0.01 Viertelkreis
gradian = gon # gon # engl. Maß
#
# solid angle units
#
[Raumwinkel]
sr = ! # Steradian
Steradian = sr
Kugel = 4 pi*sr
Halbkugel = 1/2.0 Kugel
Hemisphäre = Halbkugel
#
# information units
#
[Daten]
bit = !
Kilobit = 1000 bit # # basierend auf Basis 10
Megabit = 1000 Kilobit # # basierend auf Basis 10
Nibble = 4 bit
Byte = 8 bit
Bytes = byte
B = byte # Byte
Kilobyte = 1024 byte # # basierend auf Basis 2
kB = Kilobyte # Kilobyte # basierend auf Basis 2
Megabyte = 1024 kB # # basierend auf Basis 2
MB = Megabyte # Megabyte # basierend auf Basis 2
Gigabyte = 1024 MB # # basierend auf Basis 2
GB = Gigabyte # Gigabyte # basierend auf Basis 2
Terabyte = 1024 GB # # basierend auf Basis 2
TB = Terabyte # Terabyte # basierend auf Basis 2
petabyte = 1024 TB # # basierend auf Basis 2
PB = petabyte # Petabyte # basierend auf Basis 2
Kilobyte IEC std = 1000 byte # # basierend auf Basis 10
kB IEC std = Kilobyte IEC std # Kilobyte # basierend auf Basis 10
Megabyte IEC std = 1000 kB IEC std # # basierend auf Basis 10
MB IEC std = Megabyte IEC std # Megabyte # basierend auf Basis 10
Gigabyte IEC std = 1000 MB IEC std # # basierend auf Basis 10
GB IEC std = Gigabyte IEC std # Gigabyte # basierend auf Basis 10
Terabyte IEC std = 1000 GB IEC std # # basierend auf Basis 10
TB IEC std = terabyte IEC std # Terabyte # basierend auf Basis 10
petabyte IEC std = 1000 TB IEC std # # basierend auf Basis 10
PB IEC std = petabyte IEC std # Petabyte # basierend auf Basis 10
Kibibyte = 1024 byte
KiB = Kibibyte # Kibibyte
Mebibyte = 1024 KiB
MiB = Mebibyte # Mebibyte
Gibibyte = 1024 MiB
GiB = Gibibyte # Gibibyte
Tebibyte = 1024 GiB
TiB = Tebibyte # Tebibyte
Pebibyte = 1024 TiB
PiB = Pebibyte # Pebibyte
[Datenübertragung]
bps = bit/sec # Bit/sec
kbps = 1000 bps # Kilobit/sec # basierend auf Basis 10
Mbps = 1000 kbps # Megabit/sec # basierend auf Basis 10
Gbps = 1000 Mbps # Gigabit/sec # basierend auf Basis 10
#
# Unitless numbers
#
[Anzahl]
unit = !!
Stück = unit
1 = Stück # Stück
pi = 3.14159265358979323846 Stück # π # Kreiszahl
π = pi # # Kreiszahl
Paar = 2 Stück
hat trick = 3 Stück # # Sport
Halbstiege = 10 Stück
Dutzend = 12 Stück
dozen = Dutzend # Dutzend # engl.
Dtz = Dutzend # Dutzend
doz = Dutzend # Dutzend # engl. dozen
bakers dozen = 13 Stück # # engl.
Mandel = 15 Stück
Malter = Mandel
Große Mandel = 16 Stück
Bauernmandel = Große Mandel
score = 20 Stück # # engl.
Stiege = 20 Stück
Steige = Stiege
Band = 30 Stück
Bund = Band
Schock = 5 Dutzend
Großschock = 4 Bauernmandel
Bauernschock = Großschock
Gros = 12 Dutzend
gross = Gros # # engl.
Großgros = 12 Gros
great gross = 12 gross # # engl.
ream = 500 Stück # # engl.
Prozent = 0.01 Stück
percent = Prozent # # engl.
% = Prozent
Promille = 0.001 Stück
mill = 0.001 Stück # # engl.
[Verzinsung]
APR = [unit] log(1 + x/100) ; (exp(x) - 1)*100 \
# annual percent rate # basierend auf stetiger Verzinsung
[Konzentration]
proof = 1/200.0 Stück # # Alkoholgehalt
ppm = 1e-6 Stück # parts per million # Teile auf eine Million
parts per million = ppm # # Teile auf eine Million
ppb = 1e-9 Stück # parts per billion # Teile auf eine Milliarde
parts per billion = ppb # # Teile auf eine Milliarde
ppt = 1e-12 Stück # parts per trillion # Teile auf eine Billion
parts per trillion = ppt # # Teile auf eine Billion
Karat Gold = 1/24.0 Stück # # Goldreinheit
#
# force units
#
[Kraft]
Newton = kg*m/s^2
N = Newton # Newton
Dekanewton = 10 Newton
Kilonewton = 1000 N
kN = Kilonewton # Kilonewton
Meganewton = 1000 kN
Millinewton = 0.001 N
dyn = cm*g/s^2
dyne = dyn
Kilopond = kg * Erdbeschleunigung
kp = Kilopond # Kilopond
kg force = Kilopond # Kilopond
kgf = Kilopond # Kilopond
Pond = g * Erdbeschleunigung
gram force = Pond # Pond
pound force = lbm * Erdbeschleunigung # # Gewichtskraft eines Pfunds
lbf = pound force # pound force # Gewichtskraft eines Pfunds
ton force = ton * Erdbeschleunigung # # Gewichtskraft einer angloamer. Tonne
ounce force = ounce * Erdbeschleunigung # # Gewichtskraft einer Unze
ozf = ounce force # ounce force # Gewichtskraft einer Unze
tonne force = Tonne * Erdbeschleunigung # # Gewichtskraft einer metrischen Tonne
#
# area units
#
[Fläche]
Quadratmeter = m^2
qm = m^2 # Quadratmeter
Barn = 1e-28 m^2 # # Teilchenphysik
Ar = 100 m^2
are = Ar # # engl. Ar
Dekar = 10 Ar
Hektar = 100 Ar
acre = 10 chain^2
section = mile^2
township = 36 section
homestead = 160 acre
rai = 1600 m^2 # # Thailändisch
ngaan = 400 m^2 # # Thailändisch
circular inch = 1/4.0 pi*in^2 # # Fläche eines Kreises mit 1 Zoll Durchmesser
circular mil = 1/4.0 pi*mil^2 # # Fläche eines Kreises mit 1 Zoll Durchmesser
AWG Area = [in^2] pi/4*(92.0**((36-x)/39.0)/200.0)**2 ; \
sqrt(36 - 39.0*log(200.0*x)/log(92.0))*4/pi \
# American Wire Gauge \
# US-Maß für Drahtquerschnitte; -1, -2 für 00, 000 benutzen; nicht-linear
American Wire Gauge Area = [in^2] pi/4*(92.0**((36-x)/39.0)/200.0)**2 ; \
sqrt(36 - 39.0*log(200.0*x)/log(92.0))*4/pi \
# # US-Maß für Drahtquerschnitte; -1, -2 für 00, 000 benutzen; nicht-linear
#
# volume units
#
[Volumen]
cc = cm^3 # Kubikzentimeter # engl. cubic centimeter
Kubikzentimeter = cc
Liter = 1000 cc
l = Liter # Liter
litre = Liter # # engl.
Deziliter = 0.1 Liter
Zentiliter = 0.01 Liter
Milliliter = cc
ml = Milliliter # Milliliter
Dekaliter = 10 Liter
Hektoliter = 100 Liter
Kiloliter = 1000 Liter
kl = Kiloliter # Kiloliter
Megaliter = 1000 Kiloliter
gallon = 231 in^3 # Gallone
Gallone = gallon #
gal = gallon # Gallone
quart = 1/4.0 gallon #
qt = quart # Quart
pint = 1/2.0 quart #
pt = pint # Pint
fluid ounce = 1/16.0 pint # # Flüssigunze
fl oz = fluid ounce # fluid ounce # US
ounce fluid = fluid ounce # # US
imperial gallon = 4.54609 Liter
imp gal = imperial gallon # imperial gallon
gallon imperial = imperial gallon
imperial quart = 1/4.0 imp gal
imp qt = imperial quart # imperial quart
quart imperial = imperial quart
imperial pint = 1/8.0 imp gal
imp pt = imperial pint # imperial pint
pint imperial = imperial pint
imperial fluid ounce = 1/160.0 imp gal
imp fl oz = imperial fluid ounce # imperial fluid ounce
cup = 8 fl oz # Tasse # engl.
tablespoon = 1/16.0 cup # Esslöffel # engl.
tbsp = tablespoon # Esslöffel # engl. tablespoon
teaspoon = 1/3.0 tbsp # Teelöffel # engl.
tsp = teaspoon # Teelöffel # engl. teaspoon
barrel = 42 gallon
bbl = barrel # barrel
shot = 1.5 fl oz
fifth = 1/5.0 gallon # # Alkohol
wine bottle = 750 ml
magnum = 1.5 Liter # # Alkohol
keg = 15.5 gallon # Fass # Bierfass
hogshead wine = 63 gal
hogshead beer = 54 gal
bushel = 2150.42 in^3
peck = 1/4.0 bushel
cord = 128 ft^3
board foot = ft^2*in
board feet = board foot
#
# velocity units
#
[Geschwindigkeit]
knot = nmi/hr # Knoten # Schifffahrt
kt = knot # Knoten # Schifffahrt, engl. knot
Lichtgeschwindigkeit = 2.99792458e8 m/s # # definiert
kmh = km/hr # Kilometer/Std
Stundenkilometer = kmh # # ugs. für km/h
mph = mi/hr # Meilen pro Stunde # engl. miles per hour
Mach = 340.29 m/s # # Schallgeschwindigkeit unter Std.bedingungen
[Umdrehungsgeschw.]
rpm = rev/min # Umdrehungen/min # engl. rounds per min
rps = rev/sec # Umdrehungen/sec # engl. rounds per sec
Upm = rev/min # Umdrehungen/min
Ups = rev/sec # Umdrehungen/sec
#
# flow rate units
#
[Flüssigkeitsfluss]
gph = gal/hr # Gallonen/Std
gpm = gal/min # Gallonen/min
cfs = ft^3/sec # cu ft/sec # Kubikfuß pro Sekunde
cfm = ft^3/min # cu ft/min # Kubikfuß pro Minute
lpm = l/min # Liter/min
[Gasfluss]
sccm = atm*cc/min # std cc/min # Druck * Fluss
sccs = atm*cc/sec # std cc/sec # Druck * Fluss
slpm = atm*l/min # std Liter/min # Druck * Fluss
slph = atm*l/hr # std Liter/hr # Druck * Fluss
scfh = atm*ft^3/hr # std cu ft/hr # Druck * Fluss
scfm = atm*ft^3/min # std cu ft/min # Druck * Fluss
#
# pressure units
#
[Druck]
Pa = N/m^2 # Pascal
Pascal = Pa
hPa = 100 Pa # Hektopascal
Hektopascal = hPa
kPa = 1000 Pa # Kilopascal
Kilopascal = kPa
MPa = 1000 kPa # Megapascal
Megapascal = MPa
GPa = 1000 MPa # Gigapascal
Gigapascal = GPa
atm = 101325 Pa # Atmosphäre
Atmosphäre = atm
Atmosphären = atm
Normaldruck = atm # # definiert
bar = 1e5 Pa
mbar = 0.001 bar # Millibar
Millibar = mbar
Mikrobar = 0.001 mbar
Dezibar = 0.1 bar
Kilobar = 1000 bar
Megabar = 1000 Kilobar
mm Hg = mm*Dichte Hg*Erdgravitation # Millimeter Quecksilbersäule
Millimeter Quecksilbersäule = mm Hg
Torr = mm Hg
in Hg = in*Dichte Hg*Erdgravitation # Zoll Quecksilbersäule
Zoll Hg = in Hg # Zoll Quecksilbersäule
Zoll Quecksilbersäule = in Hg
m Wassersäule = Meter Wassersäule
m H2O = Meter Wassersäule # Meter Wassersäule
Meter Wassersäule = m*Dichte Wasser*Erdgravitation
in water = Zoll Wassersäule # Zoll Wassersäule
in H2O = Zoll Wassersäule # Zoll Wassersäule
Zoll Wassersäule = in*Dichte Wasser*Erdgravitation
ft H2O = Fuß Wassersäule # Fuß Wassersäule
Fuß Wassersäule = ft*Dichte Wasser*Erdgravitation
foot of head = Fuß Wassersäule # Fuß Wassersäule
ft hd = Fuß Wassersäule # Fuß Wassersäule # engl. foot of head
ft water = Fuß Wassersäule # Fuß Wassersäule
psi = lbf/in^2 # pound per sq inch # Pfund pro Quadratzoll (engl.)
pound per sq inch = psi
ksi = 1000 psi # kilopound per sq inch # Kilopfund pro Quadratzoll (engl. 1000 lb / sq inch)
#
# density units
#
[Dichte]
Dichte Wasser = g/cm^3
Dichte Seewasser = 1.025 g/cm^3
Dichte Hg = 13.5950981 g/cm^3 # Quecksilber
Dichte Quecksilber = Dichte Hg
Dichte Luft = 1.293 kg/m^3 # # unter Standardbedingungen
Dichte Stahl = 0.283 lb/in^3 # # Kohlenstoffstahl
Dichte Aluminium = 0.098 lb/in^3
Dichte Zink = 0.230 lb/in^3
Dichte Messing = 0.310 lb/in^3 # # 80Cu-20Zn
Dichte Kupfer = 0.295 lb/in^3
Dichte Eisen = 0.260 lb/in^3 # # Gusseisen
Dichte Nickel = 0.308 lb/in^3
Dichte Zinn = 0.275 lb/in^3
Dichte Titan = 0.170 lb/in^3
Dichte Silber = 0.379 lb/in^3
Dichte Nylon = 0.045 lb/in^3
Dichte Polykarbonat = 0.045 lb/in^3
#
# energy units
#
[Energie]
Joule = N*m
J = Joule # Joule
Kilojoule = 1000 Joule
kJ = Kilojoule # Kilojoule
Megajoule = 1000 Kilojoule
Gigajoule = 1000 Megajoule
Millijoule = 0.001 Joule
mJ = Millijoule # Millijoule
Kalorie = 4.1868 J
Kalorien = Kalorie
cal = Kalorie # Kalorie
Kilokalorie = 1000 Kalorie
kcal = Kilokalorie # Kilokalorie
Kalorien in Nahrung = Kilokalorie # Kilokalorie
thermie = 1000 kcal
Btu = cal*lb*R/(g*K) # British thermal unit
British thermal unit = Btu
therm = 100000 Btu
erg = cm*dyne
Elektronenvolt = 1.602176462e-19 J
eV = Elektronenvolt # Elektronenvolt
kWh = kW*hr # Kilowattstunde
Kilowattstunde = kWh
Tonne TNT = 4.184e9 J
Tonne Erdöläquivalent = 41.868 Gigajoule
Tonne Kohleäquivalent = 7000000 kcal
#
# power units
#
[Leistung]
Watt = J/s
W = Watt # Watt
Kilowatt = 1000 W
kW = Kilowatt # Kilowatt
Megawatt = 1000 kW
MW = Megawatt # Megawatt
Gigawatt = 1000 MW
GW = Gigawatt # Gigawatt
Milliwatt = 0.001 W
PS = 735.49875 W # Pferdestärke
Pferdestärke = PS
horsepower = 550 ft*lbf/sec # engl. Pferdestärke
hp = horsepower # engl. Pferdestärke # engl. horsepower
metric horsepower = 75 kgf*m/s # Pferdestärke
ton refrigeration = 12000 Btu/hr # # amer. Einheit für Kühlleistung
#
# frequency
#
[Frequenz]
Hertz = unit/sec
Hz = Hertz # Hertz
Millihertz = 0.001 Hz
Kilohertz = 1000 Hz
kHz = Kilohertz # Kilohertz
Megahertz = 1000 kHz
MHz = Megahertz # Megahertz
Gigahertz = 1000 MHz
GHz = Gigahertz # Gigahertz
#
# radioactivity
#
[Radioaktivität]
Becquerel = unit/sec
Bq = Becquerel # Becquerel
Curie = 3.7e10 Bq
Millicurie = 0.001 Curie
Roentgen = 2.58e-4 Coulomb/kg
Röntgen = Roentgen
[Strahlungsdosis]
Gray = J/kg
Gy = Gray # Gray
rad Dosis = 0.01 Gy # #
Sievert = J/kg # # Äquivalentdosis
Millisievert = 0.001 Sievert # # Äquivalentdosis
Sv = Sievert # Sievert # Äquivalentdosis
rem = 0.01 Sv # # Äquivalentdosis, veraltet
Millirem = 0.001 rem # # Äquivalentdosis, veraltet
#
# viscosity
#
[dyn. Viskosität]
Poise = g/(cm*s)
P = Poise # Poise
Zentipoise = 0.01 Poise
cP = Zentipoise # Zentipoise
[kinem. Viskosität]
Stokes = cm^2/s
St = Stokes # Stokes
Zentistokes = 0.01 Stokes
cSt = Zentistokes # Zentistokes
#
# misc. units
#
[Beschleunigung]
Erdbeschleunigung = 9.80665 m/s^2 # # Mittelwert, internat. Konvention
Erdschwerebeschleunigung = Erdbeschleunigung
Erdgravitation = Erdbeschleunigung
Gravitation = Erdbeschleunigung # Erdbeschleunigung
[Konstanten]
Gravitationskonstante = 6.673e-11 N*m^2/kg^2
Gaskonstante = 8.314472 J/(mol*K) # R
[Benzinverbrauch]
Meilen pro Gallone = mi/gal
mpg = Meilen pro Gallone # Meilen pro Gallone
mpg imp = mi/gallon imperial # Meilen pro Gallone (brit.)
Liter pro 100 km = 1/100.0 l/km
[Permeabilität]
Darcy = 1 cm^2*Zentipoise/atm/s
Millidarcy = 0.001 Darcy
ConvertAll/source/ 0000755 0001750 0001750 00000000000 12273255300 013104 5 ustar doug doug ConvertAll/source/option.py 0000644 0001750 0001750 00000016117 12270776462 015012 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# option.py, provides classes to read and set user preferences
#
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
import sys
import os.path
class Option:
"""Stores and retrieves string options.
"""
def __init__(self, baseFileName, keySpaces=20):
self.path = ''
if baseFileName:
if sys.platform.startswith('win'):
fileName = '{0}.ini'.format(baseFileName)
userPath = os.environ.get('APPDATA', '')
if userPath:
userPath = os.path.join(userPath, 'bellz', baseFileName)
else:
fileName = '.{0}'.format(baseFileName)
userPath = os.environ.get('HOME', '')
self.path = os.path.join(userPath, fileName)
if not os.path.exists(self.path):
modPath = os.path.abspath(sys.path[0])
if modPath.endswith('.zip') or modPath.endswith('.exe'):
modPath = os.path.dirname(modPath) # for py2exe/cx_freeze
self.path = os.path.join(modPath, fileName)
if not os.access(self.path, os.W_OK):
self.path = os.path.join(userPath, fileName)
if not os.path.exists(userPath):
try:
os.makedirs(userPath)
except OSError:
print('Error - could not write to config dir')
self.path = ''
self.keySpaces = keySpaces
self.dfltDict = {}
self.userDict = {}
self.dictList = (self.userDict, self.dfltDict)
self.chgList = []
def loadAll(self, defaultList):
"""Reads defaultList & file, writes file if required
return true if file read.
"""
self.loadSet(defaultList, self.dfltDict)
if self.path:
try:
with open(self.path, 'r', encoding='utf-8') as f:
self.loadSet(f.readlines(), self.userDict)
return True
except IOError:
try:
with open(self.path, 'w', encoding='utf-8') as f:
f.writelines([line + '\n' for line in defaultList])
except IOError:
print('Error - could not write to config file', self.path)
self.path = ''
return False
def loadSet(self, list, data):
"""Reads settings from list into dict.
"""
for line in list:
line = line.split('#', 1)[0].strip()
if line:
item = line.split(None, 1) + [''] # add value if blank
data[item[0]] = item[1].strip()
def addData(self, key, strData, storeChange=0):
"""Add new entry, add to write list if storeChange.
"""
self.userDict[key] = strData
if storeChange:
self.chgList.append(key)
def boolData(self, key):
"""Returns true or false from yes or no in option data.
"""
for data in self.dictList:
val = data.get(key)
if val and val[0] in ('y', 'Y'):
return True
if val and val[0] in ('n', 'N'):
return False
print('Option error - bool key', key, 'is not valid')
return False
def numData(self, key, min=None, max=None):
"""Return float from option data.
"""
for data in self.dictList:
val = data.get(key)
if val:
try:
num = float(val)
if (min == None or num >= min) and \
(max == None or num <= max):
return num
except ValueError:
pass
print('Option error - float key', key, 'is not valid')
return 0
def intData(self, key, min=None, max=None):
"""Return int from option data.
"""
for data in self.dictList:
val = data.get(key)
if val:
try:
num = int(val)
if (min == None or num >= min) and \
(max == None or num <= max):
return num
except ValueError:
pass
print('Option error - int key', key, 'is not valid')
return 0
def strData(self, key, emptyOk=0):
"""Return string from option data.
"""
for data in self.dictList:
val = data.get(key)
if val != None:
if val or emptyOk:
return val
print('Option error - string key', key, 'is not valid')
return ''
def changeData(self, key, strData, storeChange):
"""Change entry, add to write list if storeChange
Return true if changed.
"""
for data in self.dictList:
val = data.get(key)
if val != None:
if strData == val: # no change reqd
return False
self.userDict[key] = strData
if storeChange:
self.chgList.append(key)
return True
print('Option error - key', key, 'is not valid')
return False
def writeChanges(self):
"""Write any stored changes to the option file - rtn true on success.
"""
if self.path and self.chgList:
try:
with open(self.path, 'r', encoding='utf-8') as f:
fileList = f.readlines()
for key in self.chgList[:]:
hitList = [line for line in fileList if
line.strip().split(None, 1)[:1] == [key]]
if not hitList:
hitList = [line for line in fileList if
line.replace('#', ' ', 1).strip().
split(None, 1)[:1] == [key]]
if hitList:
fileList[fileList.index(hitList[-1])] = '{0}{1}\n'.\
format(key.ljust(self.keySpaces),
self.userDict[key])
self.chgList.remove(key)
for key in self.chgList:
fileList.append('{0}{1}\n'.format(key.ljust(self.keySpaces),
self.userDict[key]))
with open(self.path, 'w', encoding='utf-8') as f:
f.writelines([line for line in fileList])
return True
except IOError:
print('Error - could not write to config file', self.path)
return False
ConvertAll/source/recentunits.py 0000644 0001750 0001750 00000003775 12270342155 016037 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# recentunits.py, provides a list of recently used units
#
# ConvertAll, a units conversion program
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
class RecentUnits(list):
"""A list of recent unit combo names.
"""
def __init__(self, options):
list.__init__(self)
self.options = options
self.updateQuantity()
self.loadList()
def updateQuantity(self):
"""Update number of entries from options.
"""
self.numEntries = self.options.intData('RecentUnits', 0, 99)
del self[self.numEntries:]
def loadList(self):
"""Load recent units from option file.
"""
self[:] = []
for num in range(self.numEntries):
name = self.options.strData(self.optionTitle(num), True)
if name:
self.append(name)
def writeList(self):
"""Write list of paths to options.
"""
for num in range(self.numEntries):
try:
name = self[num]
except IndexError:
name = ''
self.options.changeData(self.optionTitle(num), name, True)
self.options.writeChanges()
def addEntry(self, name):
"""Move name to start if found, otherwise add it.
"""
try:
self.remove(name)
except ValueError:
pass
self.insert(0, name)
del self[self.numEntries:]
def optionTitle(self, num):
"""Return option key for the given nummber.
"""
return 'RecentUnit{0}'.format(num + 1)
ConvertAll/source/setup.py 0000644 0001750 0001750 00000003250 12272602764 014627 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# setup.py, provides a distutils script for use with cx_Freeze
#
# Creates a standalone windows executable
#
# Run the build process by running the command 'python setup.py build'
#
# If everything works well you should find a subdirectory in the build
# subdirectory that contains the files needed to run the application
#
# ConvertAll, a units conversion program
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
import sys
from cx_Freeze import setup, Executable
from convertall import __version__
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
extraFiles = [('../data', 'data'), ('../doc', 'doc'), ('../icons', 'icons'),
('../source', 'source'), ('../translations', 'translations'),
('../win', '.')]
setup(name = 'convertall',
version = __version__,
description = 'ConvertAll, a units conversion program',
options = {'build_exe': {'includes': 'atexit',
'include_files': extraFiles,
'excludes': ['*.pyc'],
'icon': '../win/convertall.ico',
'build_exe': '../../convertall-0.6'}},
executables = [Executable('convertall.py', base=base)])
ConvertAll/source/unitatom.py 0000644 0001750 0001750 00000010350 12270342155 015317 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# unitatom.py, provides class to hold data on each available unit
#
# ConvertAll, a units conversion program
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
import re
import copy
import unitdata
class UnitAtom(object):
"""Reads and stores a single unit conversion.
"""
partialExp = 1000
badOpRegEx = re.compile(r'[^\d\.eE\+\-\*/]')
eqnRegEx = re.compile(r'\[(.*?)\](.*)')
def __init__(self, dataStr):
dataList = dataStr.split('#')
unitList = dataList.pop(0).split('=', 1)
self.name = unitList.pop(0).strip()
self.equiv = ''
self.factor = 1.0
self.fromEqn = '' # used only for non-linear units
self.toEqn = '' # used only for non-linear units
if unitList:
self.equiv = unitList[0].strip()
if self.equiv[0] == '[': # used only for non-linear units
try:
self.equiv, self.fromEqn = UnitAtom.eqnRegEx.\
match(self.equiv).groups()
if ';' in self.fromEqn:
self.fromEqn, self.toEqn = self.fromEqn.split(';', 1)
self.toEqn = self.toEqn.strip()
self.fromEqn = self.fromEqn.strip()
except AttributeError:
raise unitdata.UnitDataError(_('Bad equation for "{0}"').
format(self.name))
else: # split factor and equiv unit for linear
parts = self.equiv.split(None, 1)
if len(parts) > 1 and \
UnitAtom.badOpRegEx.search(parts[0]) == None:
# only allowed digits and operators
try:
self.factor = float(eval(parts[0]))
self.equiv = parts[1]
except:
pass
self.comments = [comm.strip() for comm in dataList]
self.comments.extend([''] * (2 - len(self.comments)))
self.exp = 1
self.viewLink = [None, None]
self.typeName = ''
def description(self):
"""Return name and 1st comment (usu. full name) if applicable.
"""
if self.comments[0]:
return '{0} ({1})'.format(self.name, self.comments[0])
return self.name
def unitValid(self):
"""Return True if unit and exponent are valid.
"""
if self.equiv and \
-UnitAtom.partialExp < self.exp < UnitAtom.partialExp:
return True
return False
def unitText(self, absExp=False):
"""Return text for unit name with exponent or absolute value of exp.
"""
exp = self.exp
if absExp:
exp = abs(self.exp)
if exp == 1:
return self.name
if -UnitAtom.partialExp < exp < UnitAtom.partialExp:
return '{0}^{1}'.format(self.name, exp)
if exp > 1:
return '{0}^'.format(self.name)
else:
return '{0}^-'.format(self.name)
def matchWords(self, wordList):
"""Return True if unit name and comments match word list.
"""
dataStr = ' '.join((self.name, self.comments[0],
self.comments[1])).lower()
for word in wordList:
if dataStr.find(word) == -1:
return False
return True
def copy(self):
"""Return a copy of the unit so the exponent can be changed.
"""
return copy.copy(self)
def __lt__(self, other):
"""Less than comparison for sorting.
"""
return self.name.lower() < other.name.lower()
def __eq__(self, other):
"""Equality test.
"""
return self.name.lower() == other.name.lower()
ConvertAll/source/convertall.py 0000755 0001750 0001750 00000011451 12272073252 015637 0 ustar doug doug #!/usr/bin/env python3
"""
****************************************************************************
convertall.py, the main program file
ConvertAll, a units conversion program
Copyright (C) 2014, Douglas W. Bell
This is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License, either Version 2 or any later
version. This program is distributed in the hope that it will be useful,
but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
*****************************************************************************
"""
__progname__ = 'ConvertAll'
__version__ = '0.6.0'
__author__ = 'Doug Bell'
dataFilePath = None # modified by install script if required
helpFilePath = None # modified by install script if required
iconPath = None # modified by install script if required
translationPath = 'translations'
lang = ''
import sys
import os.path
import locale
import getopt
import signal
import builtins
from PyQt4 import QtCore, QtGui
def loadTranslator(fileName, app):
"""Load and install qt translator, return True if sucessful.
"""
translator = QtCore.QTranslator(app)
modPath = os.path.abspath(sys.path[0])
if modPath.endswith('.zip'): # for py2exe
modPath = os.path.dirname(modPath)
path = os.path.join(modPath, translationPath)
result = translator.load(fileName, path)
if not result:
path = os.path.join(modPath, '..', translationPath)
result = translator.load(fileName, path)
if not result:
path = os.path.join(modPath, '..', 'i18n', translationPath)
result = translator.load(fileName, path)
if result:
QtCore.QCoreApplication.installTranslator(translator)
return True
else:
print('Warning: translation file "{0}" could not be loaded'.
format(fileName))
return False
def setupTranslator(app):
"""Set language, load translators and setup translator function.
"""
try:
locale.setlocale(locale.LC_ALL, '')
except locale.Error:
pass
global lang
lang = os.environ.get('LC_MESSAGES', '')
if not lang:
lang = os.environ.get('LANG', '')
if not lang:
try:
lang = locale.getdefaultlocale()[0]
except ValueError:
pass
if not lang:
lang = ''
numTranslators = 0
if lang and lang[:2] not in ['C', 'en']:
numTranslators += loadTranslator('qt_{0}'.format(lang), app)
numTranslators += loadTranslator('convertall_{0}'.format(lang), app)
def translate(text, comment=''):
"""Translation function that sets context to calling module's
filename.
"""
try:
frame = sys._getframe(1)
fileName = frame.f_code.co_filename
finally:
del frame
context = os.path.basename(os.path.splitext(fileName)[0])
return QtCore.QCoreApplication.translate(context, text, comment)
def markNoTranslate(text, comment=''):
return text
if numTranslators:
builtins._ = translate
else:
builtins._ = markNoTranslate
def main():
if len(sys.argv) > 1:
try:
opts, args = getopt.gnu_getopt(sys.argv, 'd:fhiqst',
['decimals=', 'fixed-decimals',
'help', 'interactive', 'quiet',
'sci-notation', 'test'])
except getopt.GetoptError:
# check that arguments aren't Qt GUI options
if sys.argv[1][:3] not in ['-ba', '-bg', '-bt', '-bu', '-cm',
'-di', '-do', '-fg', '-fn', '-fo',
'-ge', '-gr', '-im', '-in', '-na',
'-nc', '-no', '-re', '-se', '-st',
'-sy', '-ti', '-vi', '-wi']:
app = QtCore.QCoreApplication(sys.argv)
setupTranslator(app)
import cmdline
cmdline.printUsage()
sys.exit(2)
else:
app = QtCore.QCoreApplication(sys.argv)
setupTranslator(app)
import cmdline
try:
cmdline.parseArgs(opts, args[1:])
except KeyboardInterrupt:
pass
return
userStyle = '-style' in ' '.join(sys.argv)
app = QtGui.QApplication(sys.argv)
setupTranslator(app) # must be before importing any convertall modules
import convertdlg
if not userStyle and not sys.platform.startswith('win'):
QtGui.QApplication.setStyle('plastique')
win = convertdlg.ConvertDlg()
win.show()
signal.signal(signal.SIGINT, signal.SIG_IGN)
app.exec_()
if __name__ == '__main__':
main()
ConvertAll/source/helpview.py 0000644 0001750 0001750 00000011721 12270342155 015305 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# helpview.py, provides a window for viewing an html help file
#
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
import os.path
import sys
import webbrowser
from PyQt4 import QtCore, QtGui
class HelpView(QtGui.QMainWindow):
"""Main window for viewing an html help file.
"""
def __init__(self, path, caption, icons, parent=None):
"""Helpview initialize with text.
"""
QtGui.QMainWindow.__init__(self, parent)
self.setAttribute(QtCore.Qt.WA_QuitOnClose, False)
self.setWindowFlags(QtCore.Qt.Window)
self.setStatusBar(QtGui.QStatusBar())
self.textView = HelpViewer(self)
self.setCentralWidget(self.textView)
path = os.path.abspath(path)
if sys.platform.startswith('win'):
path = path.replace('\\', '/')
self.textView.setSearchPaths([os.path.dirname(path)])
self.textView.setSource(QtCore.QUrl('file:///{0}'.format(path)))
self.resize(520, 440)
self.setWindowTitle(caption)
tools = self.addToolBar('Tools')
self.menu = QtGui.QMenu(self.textView)
self.textView.highlighted[str].connect(self.showLink)
backAct = QtGui.QAction(_('&Back'), self)
backAct.setIcon(icons['helpback'])
tools.addAction(backAct)
self.menu.addAction(backAct)
backAct.triggered.connect(self.textView.backward)
backAct.setEnabled(False)
self.textView.backwardAvailable.connect(backAct.setEnabled)
forwardAct = QtGui.QAction(_('&Forward'), self)
forwardAct.setIcon(icons['helpforward'])
tools.addAction(forwardAct)
self.menu.addAction(forwardAct)
forwardAct.triggered.connect(self.textView.forward)
forwardAct.setEnabled(False)
self.textView.forwardAvailable.connect(forwardAct.setEnabled)
homeAct = QtGui.QAction(_('&Home'), self)
homeAct.setIcon(icons['helphome'])
tools.addAction(homeAct)
self.menu.addAction(homeAct)
homeAct.triggered.connect(self.textView.home)
tools.addSeparator()
tools.addSeparator()
findLabel = QtGui.QLabel(' {0}: '.format(_('Find')), self)
tools.addWidget(findLabel)
self.findEdit = QtGui.QLineEdit(self)
tools.addWidget(self.findEdit)
self.findEdit.textEdited.connect(self.findTextChanged)
self.findEdit.returnPressed.connect(self.findNext)
self.findPreviousAct = QtGui.QAction(_('Find &Previous'), self)
self.findPreviousAct.setIcon(icons['helpprevious'])
tools.addAction(self.findPreviousAct)
self.menu.addAction(self.findPreviousAct)
self.findPreviousAct.triggered.connect(self.findPrevious)
self.findPreviousAct.setEnabled(False)
self.findNextAct = QtGui.QAction(_('Find &Next'), self)
self.findNextAct.setIcon(icons['helpnext'])
tools.addAction(self.findNextAct)
self.menu.addAction(self.findNextAct)
self.findNextAct.triggered.connect(self.findNext)
self.findNextAct.setEnabled(False)
def showLink(self, text):
"""Send link text to the statusbar.
"""
self.statusBar().showMessage(text)
def findTextChanged(self, text):
"""Update find controls based on text in text edit.
"""
self.findPreviousAct.setEnabled(len(text) > 0)
self.findNextAct.setEnabled(len(text) > 0)
def findPrevious(self):
"""Command to find the previous string.
"""
if self.textView.find(self.findEdit.text(),
QtGui.QTextDocument.FindBackward):
self.statusBar().clearMessage()
else:
self.statusBar().showMessage(_('Text string not found'))
def findNext(self):
"""Command to find the next string.
"""
if self.textView.find(self.findEdit.text()):
self.statusBar().clearMessage()
else:
self.statusBar().showMessage(_('Text string not found'))
class HelpViewer(QtGui.QTextBrowser):
"""Shows an html help file.
"""
def __init__(self, parent=None):
QtGui.QTextBrowser.__init__(self, parent)
def setSource(self, url):
"""Called when user clicks on a URL.
"""
name = url.toString()
if name.startswith('http'):
webbrowser.open(name, True)
else:
QtGui.QTextBrowser.setSource(self, QtCore.QUrl(name))
def contextMenuEvent(self, event):
"""Init popup menu on right click"".
"""
self.parentWidget().menu.exec_(event.globalPos())
ConvertAll/source/unitedit.py 0000644 0001750 0001750 00000006410 12270342155 015306 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# unitedit.py, provides a line edit for unit entry
#
# ConvertAll, a units conversion program
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
from PyQt4 import QtCore, QtGui
class UnitEdit(QtGui.QLineEdit):
"""Text line editor for unit entry.
"""
unitChanged = QtCore.pyqtSignal()
currentChanged = QtCore.pyqtSignal()
def __init__(self, unitGroup, parent=None):
QtGui.QLineEdit.__init__(self, parent)
self.unitGroup = unitGroup
self.textEdited.connect(self.updateGroup)
self.cursorPositionChanged.connect(self.updateCurrentUnit)
def unitUpdate(self):
"""Update text from unit group.
"""
newText = self.unitGroup.unitString()
cursorPos = len(newText) - len(self.text()) + self.cursorPosition()
if cursorPos < 0: # cursor set to same distance from right end
cursorPos = 0
self.blockSignals(True)
self.setText(newText)
self.setCursorPosition(cursorPos)
self.blockSignals(False)
self.unitChanged.emit()
def updateGroup(self):
"""Update unit based on edit text change (except spacing change).
"""
if self.text().replace(' ', '') \
!= self.unitGroup.unitString().replace(' ', ''):
self.unitGroup.update(self.text(), self.cursorPosition())
self.currentChanged.emit() # update listView
self.unitUpdate() # replace text with formatted text
def updateCurrentUnit(self):
"""Change current unit based on cursor movement.
"""
self.unitGroup.updateCurrentUnit(self.text(),
self.cursorPosition())
self.currentChanged.emit() # update listView
def keyPressEvent(self, event):
"""Keys for return and up/down.
"""
if event.key() == QtCore.Qt.Key_Up:
self.unitGroup.moveToNext(True)
self.currentChanged.emit() # update listView
self.unitUpdate()
elif event.key() == QtCore.Qt.Key_Down:
self.unitGroup.moveToNext(False)
self.currentChanged.emit() # update listView
self.unitUpdate()
elif event.key() in (QtCore.Qt.Key_Return, QtCore.Qt.Key_Enter):
self.unitGroup.completePartial()
self.currentChanged.emit() # update listView
self.unitUpdate()
else:
QtGui.QLineEdit.keyPressEvent(self, event)
def event(self, event):
"""Catch tab press to complete unit.
"""
if event.type() == QtCore.QEvent.KeyPress and \
event.key() == QtCore.Qt.Key_Tab:
self.unitGroup.completePartial()
self.currentChanged.emit() # update listView
self.unitUpdate()
return QtGui.QLineEdit.event(self, event)
ConvertAll/source/optiondefaults.py 0000644 0001750 0001750 00000003274 12271600271 016523 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# optiondefaults.py, provides defaults for program options
#
# ConvertAll, a units conversion program
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
defaultList = [
"# Options for the ConvertAll unit conversion program",
"#",
"# All options are set from within the program,",
"# editing here is not recommended",
"#",
"UseDefaultColors yes",
"BackgroundR 255",
"BackgroundG 255",
"BackgroundB 255",
"ForegroundR 0",
"ForegroundG 0",
"ForegroundB 0",
"#",
"DecimalPlaces 8",
"SciNotation no",
"FixedDecimals no",
"ShowOpButtons yes",
"RecentUnits 8",
"LoadLastUnit no",
"ShowStartupTip yes",
"#",
"MainDlgXSize 0",
"MainDlgYSize 0",
"MainDlgXPos 0",
"MainDlgYPos 0",
"FinderXSize 0",
"FinderYSize 0",
"FinderXPos 0",
"FinderYPos 0",
"#",
"RecentUnit1 ",
"RecentUnit2 ",
"RecentUnit3 ",
"RecentUnit4 ",
"RecentUnit5 ",
"RecentUnit6 ",
"RecentUnit7 ",
"RecentUnit8 "]
ConvertAll/source/icondict.py 0000644 0001750 0001750 00000005357 12270102756 015267 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# icondict.py, provides a class to load and store icons
#
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
import os.path
from PyQt4 import QtCore, QtGui
class IconDict(dict):
"""Stores icons by name, loads on demand.
"""
iconExt = ['.png', '.bmp']
def __init__(self):
dict.__init__(self, {})
self.pathList = []
def addIconPath(self, potentialPaths):
"""Add first good path from potentialPaths.
"""
for path in potentialPaths:
try:
for name in os.listdir(path):
pixmap = QtGui.QPixmap(os.path.join(path, name))
if not pixmap.isNull():
self.pathList.append(path)
return
except OSError:
pass
def __getitem__(self, name):
"""Return icon, loading if necessary.
"""
try:
return dict.__getitem__(self, name)
except KeyError:
icon = self.loadIcon(name)
if not icon:
raise
return icon
def loadAllIcons(self):
"""Load all icons available in self.pathList.
"""
self.clear()
for path in self.pathList:
try:
for name in os.listdir(path):
pixmap = QtGui.QPixmap(os.path.join(path, name))
if not pixmap.isNull():
name = os.path.splitext(name)[0]
try:
icon = self[name]
except KeyError:
icon = QtGui.QIcon()
self[name] = icon
icon.addPixmap(pixmap)
except OSError:
pass
def loadIcon(self, iconName):
"""Load icon from iconPath, add to dictionary and return the icon.
"""
icon = QtGui.QIcon()
for path in self.pathList:
for ext in IconDict.iconExt:
fileName = iconName + ext
pixmap = QtGui.QPixmap(os.path.join(path, fileName))
if not pixmap.isNull():
icon.addPixmap(pixmap)
if not icon.isNull():
self[iconName] = icon
return icon
return None
ConvertAll/source/optiondlg.py 0000644 0001750 0001750 00000020767 12270342155 015473 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# optiondlg.py, provides classes for option setting dialogs
#
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
import sys
from PyQt4 import QtCore, QtGui
class OptionDlg(QtGui.QDialog):
"""Works with Option class to provide a dialog for pref/options.
"""
def __init__(self, option, parent=None):
QtGui.QDialog.__init__(self, parent)
self.setWindowFlags(QtCore.Qt.Dialog | QtCore.Qt.WindowTitleHint |
QtCore.Qt.WindowSystemMenuHint)
self.option = option
topLayout = QtGui.QVBoxLayout(self)
self.setLayout(topLayout)
self.columnLayout = QtGui.QHBoxLayout()
topLayout.addLayout(self.columnLayout)
self.gridLayout = QtGui.QGridLayout()
self.columnLayout.addLayout(self.gridLayout)
self.oldLayout = self.gridLayout
ctrlLayout = QtGui.QHBoxLayout()
topLayout.addLayout(ctrlLayout)
ctrlLayout.addStretch(0)
okButton = QtGui.QPushButton(_('&OK'), self)
ctrlLayout.addWidget(okButton)
okButton.clicked.connect(self.accept)
cancelButton = QtGui.QPushButton(_('&Cancel'), self)
ctrlLayout.addWidget(cancelButton)
cancelButton.clicked.connect(self.reject)
self.setWindowTitle(_('Preferences'))
self.itemList = []
self.curGroup = None
def addItem(self, dlgItem, widget, label=None):
"""Add a control with optional label, called by OptionDlgItem.
"""
row = self.gridLayout.rowCount()
if label:
self.gridLayout.addWidget(label, row, 0)
self.gridLayout.addWidget(widget, row, 1)
else:
self.gridLayout.addWidget(widget, row, 0, 1, 2)
self.itemList.append(dlgItem)
def startGroupBox(self, title, intSpace=5):
"""Use a group box for next added items.
"""
self.curGroup = QtGui.QGroupBox(title, self)
row = self.oldLayout.rowCount()
self.oldLayout.addWidget(self.curGroup, row, 0, 1, 2)
self.gridLayout = QtGui.QGridLayout(self.curGroup)
self.gridLayout.setVerticalSpacing(intSpace)
def endGroupBox(self):
"""Cancel group box for next added items.
"""
self.gridLayout = self.oldLayout
self.curGroup = None
def startNewColumn(self):
"""Cancel any group box and start a second column.
"""
self.curGroup = None
row = self.oldLayout.rowCount()
self.gridLayout = QtGui.QGridLayout()
self.columnLayout.addLayout(self.gridLayout)
self.oldLayout = self.gridLayout
def parentGroup(self):
"""Return parent for new widgets.
"""
if self.curGroup:
return self.curGroup
return self
def accept(self):
"""Called by dialog when OK button pressed.
"""
for item in self.itemList:
item.updateData()
QtGui.QDialog.accept(self)
class OptionDlgItem:
"""Base class for items to add to dialog.
"""
def __init__(self, dlg, key, writeChg):
self.dlg = dlg
self.key = key
self.writeChg = writeChg
self.control = None
def updateData(self):
"""Dummy update function.
"""
pass
class OptionDlgBool(OptionDlgItem):
"""Holds widget for bool checkbox.
"""
def __init__(self, dlg, key, menuText, writeChg=True):
OptionDlgItem.__init__(self, dlg, key, writeChg)
self.control = QtGui.QCheckBox(menuText, dlg.parentGroup())
self.control.setChecked(dlg.option.boolData(key))
dlg.addItem(self, self.control)
def updateData(self):
"""Update Option class based on checkbox status.
"""
if self.control.isChecked() != self.dlg.option.boolData(self.key):
if self.control.isChecked():
self.dlg.option.changeData(self.key, 'yes', self.writeChg)
else:
self.dlg.option.changeData(self.key, 'no', self.writeChg)
class OptionDlgInt(OptionDlgItem):
"""Holds widget for int spinbox.
"""
def __init__(self, dlg, key, menuText, min, max, writeChg=True, step=1,
wrap=False, suffix=''):
OptionDlgItem.__init__(self, dlg, key, writeChg)
label = QtGui.QLabel(menuText, dlg.parentGroup())
self.control = QtGui.QSpinBox(dlg.parentGroup())
self.control.setMinimum(min)
self.control.setMaximum(max)
self.control.setSingleStep(step)
self.control.setWrapping(wrap)
self.control.setSuffix(suffix)
self.control.setValue(dlg.option.intData(key, min, max))
dlg.addItem(self, self.control, label)
def updateData(self):
"""Update Option class based on spinbox status.
"""
if self.control.value() != int(self.dlg.option.numData(self.key)):
self.dlg.option.changeData(self.key, repr(self.control.value()),
self.writeChg)
class OptionDlgDbl(OptionDlgItem):
"""Holds widget for double line edit.
"""
def __init__(self, dlg, key, menuText, min, max, writeChg=True):
OptionDlgItem.__init__(self, dlg, key, writeChg)
label = QtGui.QLabel(menuText, dlg.parentGroup())
self.control = QtGui.QLineEdit(repr(dlg.option.numData(key, min, max)),
dlg.parentGroup())
valid = QtGui.QDoubleValidator(min, max, 6, self.control)
self.control.setValidator(valid)
dlg.addItem(self, self.control, label)
def updateData(self):
"""Update Option class based on edit status.
"""
text = self.control.text()
unusedPos = 0
if self.control.validator().validate(text, unusedPos)[0] != \
QtGui.QValidator.Acceptable:
return
num = float(text)
if num != self.dlg.option.numData(self.key):
self.dlg.option.changeData(self.key, repr(num), self.writeChg)
class OptionDlgStr(OptionDlgItem):
"""Holds widget for string line edit.
"""
def __init__(self, dlg, key, menuText, writeChg=True):
OptionDlgItem.__init__(self, dlg, key, writeChg)
label = QtGui.QLabel(menuText, dlg.parentGroup())
self.control = QtGui.QLineEdit(dlg.option.strData(key, True),
dlg.parentGroup())
dlg.addItem(self, self.control, label)
def updateData(self):
"""Update Option class based on edit status.
"""
newStr = self.control.text()
if newStr != self.dlg.option.strData(self.key, True):
self.dlg.option.changeData(self.key, newStr, self.writeChg)
class OptionDlgRadio(OptionDlgItem):
"""Holds widget for exclusive radio button group.
"""
def __init__(self, dlg, key, headText, textList, writeChg=True):
# textList is list of tuples: optionText, labelText
OptionDlgItem.__init__(self, dlg, key, writeChg)
self.optionList = [x[0] for x in textList]
buttonBox = QtGui.QGroupBox(headText, dlg.parentGroup())
self.control = QtGui.QButtonGroup(buttonBox)
layout = QtGui.QVBoxLayout(buttonBox)
buttonBox.setLayout(layout)
optionSetting = dlg.option.strData(key)
id = 0
for optionText, labelText in textList:
button = QtGui.QRadioButton(labelText, buttonBox)
layout.addWidget(button)
self.control.addButton(button, id)
id += 1
if optionText == optionSetting:
button.setChecked(True)
dlg.addItem(self, buttonBox)
def updateData(self):
"""Update Option class based on button status.
"""
data = self.optionList[self.control.checkedId()]
if data != self.dlg.option.strData(self.key):
self.dlg.option.changeData(self.key, data, self.writeChg)
class OptionDlgPush(OptionDlgItem):
"""Holds widget for extra misc. push button.
"""
def __init__(self, dlg, text, cmd):
OptionDlgItem.__init__(self, dlg, '', 0)
self.control = QtGui.QPushButton(text, dlg.parentGroup())
self.control.clicked.connect(cmd)
dlg.addItem(self, self.control)
ConvertAll/source/unitgroup.py 0000644 0001750 0001750 00000037344 12270342155 015527 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# unitgroup.py, provides a group of units and does conversions
#
# ConvertAll, a units conversion program
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
import re
from math import *
from unitatom import UnitAtom
import unitdata
class UnitGroup(object):
"""Stores, updates and converts a group of units.
"""
maxDecPlcs = 12
operRegEx = re.compile(r'[\*/]')
operGroupRegEx = re.compile(r'(\(.*\)|\(.*$|[\*/])')
def __init__(self, unitData, option):
self.unitData = unitData
self.option = option
self.unitList = []
self.currentNum = 0
self.factor = 1.0
self.reducedList = []
self.linear = True
self.parenthClosed = True
def flatUnitList(self):
"""Return the units with sub-groups flattened.
"""
result = []
for unit in self.unitList:
if hasattr(unit, 'flatUnitList'):
result.extend(unit.flatUnitList())
else:
result.append(unit)
return result
def unitGroups(self):
"""Return a list of this unit group and all sub-groups.
"""
result = [self]
for group in self.unitList:
if hasattr(group, 'unitGroups'):
result.extend(group.unitGroups())
return result
def unitGroupExpSign(self):
"""Return True if the first unit's exponent is positive.
"""
unitList = self.unitList
while unitList and not hasattr(unitList[0], 'exp'):
unitList = unitList[0].unitList
if unitList and unitList[0].exp < 0:
return False
return True
def currentGroupPos(self):
"""Return a tuple of the group and position of the current unit.
"""
currentUnit = self.currentUnit()
if currentUnit:
for group in self.unitGroups():
for i in range(len(group.unitList)):
if group.unitList[i] is currentUnit:
return (group, i)
return (self, 0)
def update(self, text, cursorPos=None):
"""Decode user entered text into units.
"""
self.unitList = self.parseGroup(text)
if cursorPos != None:
self.updateCurrentUnit(text, cursorPos)
else:
self.currentNum = len(self.flatUnitList()) - 1
def updateCurrentUnit(self, text, cursorPos):
"""Set current unit number.
"""
self.currentNum = len(UnitGroup.operRegEx.findall(text[:cursorPos]))
def currentUnit(self):
"""Return current unit if set, o/w None.
"""
try:
return self.flatUnitList()[self.currentNum]
except IndexError:
return None
def currentPartialUnit(self):
"""Return unit with at least a partial match, o/w None.
"""
currentUnit = self.currentUnit()
if not currentUnit:
return None
return self.unitData.findPartialMatch(currentUnit.name)
def currentSortPos(self):
"""Return unit near current unit for sorting.
"""
try:
return self.unitData.findSortPos(self.currentUnit().name)
except AttributeError:
return self.unitData[self.unitData.sortedKeys[0]]
def replaceCurrent(self, newUnit):
"""Replace the current unit with unit.
"""
if self.unitList:
oldUnit = self.currentUnit()
group, pos = self.currentGroupPos()
group.unitList[pos] = newUnit.copy()
group.unitList[pos].exp = oldUnit.exp
return
self.unitList.append(newUnit.copy())
def completePartial(self):
"""Replace a partial unit with a full one.
"""
partUnit = self.currentUnit()
if partUnit and not partUnit.equiv:
newUnit = self.unitData.findPartialMatch(partUnit.name)
if newUnit:
self.replaceCurrent(newUnit)
def moveToNext(self, upward):
"""Replace unit with adjacent one based on match or sort position.
"""
unit = self.currentSortPos()
name = unit.name.lower().replace(' ', '')
num = self.unitData.sortedKeys.index(name) + (upward and -1 or 1)
if 0 <= num < len(self.unitData.sortedKeys):
self.replaceCurrent(self.unitData[self.unitData.sortedKeys[num]])
def addOper(self, mult):
"""Add new operator & blank unit after current, * if mult is true.
"""
if self.unitList:
self.completePartial()
group, pos = self.currentGroupPos()
self.currentNum += 1
group.unitList.insert(pos + 1, UnitAtom(''))
if not mult:
self.currentUnit().exp = -1
def changeExp(self, newExp):
"""Change the current unit's exponent.
"""
self.completePartial()
currentUnit = self.currentUnit()
if currentUnit:
if currentUnit.exp > 0:
currentUnit.exp = newExp
else:
currentUnit.exp = -newExp
def clearUnit(self):
"""Remove units.
"""
self.unitList = []
self.currentNum = 0
self.factor = 1.0
self.reducedList = []
self.linear = True
def parseGroup(self, text):
"""Return list of units from text string.
"""
unitList = []
parts = [part.strip() for part in UnitGroup.operGroupRegEx.split(text)
if part.strip()]
numerator = True
while parts:
part = parts.pop(0)
if part == '*' or part == '/':
parts.insert(0, part)
part = '' # add blank invalid unit if order wrong
if part.startswith('('):
part = part[1:]
group = UnitGroup(self.unitData, self.option)
if part.endswith(')'):
part = part[:-1]
else:
group.parenthClosed = False
group.update(part)
if not group.unitList:
group.unitList.append(group.parseUnit(''))
if not numerator:
for unit in group.flatUnitList():
unit.exp = -unit.exp
unitList.append(group)
else:
unit = self.parseUnit(part)
if not numerator:
unit.exp = -unit.exp
unitList.append(unit)
if parts:
oper = parts.pop(0)
if oper == '*' or oper == '/':
numerator = oper == '*' and True or False
if not parts:
parts.insert(0, '') # add blank invalid unit at end
else:
parts.insert(0, oper) # put unit back if order wrong
return unitList
def parseUnit(self, text):
"""Return a valid or invalid unit with exponent from a text string.
"""
parts = text.split('^', 1)
exp = 1
if len(parts) > 1: # has exponent
try:
exp = int(parts[1])
except ValueError:
if parts[1].lstrip().startswith('-'):
exp = -UnitAtom.partialExp # tmp invalid exp
else:
exp = UnitAtom.partialExp
unitText = parts[0].strip().lower().replace(' ', '')
unit = self.unitData.get(unitText, None)
if not unit and unitText and unitText[-1] == 's' and not \
self.unitData.findPartialMatch(unitText): # check for plural
unit = self.unitData.get(unitText[:-1], None)
if not unit:
unit = UnitAtom('') # tmp invalid unit
unit.name = parts[0].strip()
unit = unit.copy()
unit.exp = exp
return unit
def unitString(self, unitList=None, swapExpSign=False):
"""Return the full string for this group or a given group.
"""
if unitList == None:
unitList = self.unitList
fullText = ''
if unitList:
firstUnit = True
for unit in unitList:
if not firstUnit:
if hasattr(unit, 'exp'):
expSign = unit.exp > 0
else:
expSign = unit.unitGroupExpSign()
if swapExpSign:
expSign = not expSign
fullText = '{0} {1} '.format(fullText,
expSign and '*' or '/')
if hasattr(unit, 'unitText'):
fullText = '{0}{1}'.format(fullText,
unit.unitText(swapExpSign or
not firstUnit))
else:
if firstUnit and not swapExpSign:
swap = False
else:
swap = not unit.unitGroupExpSign()
fullText = '{0}({1}{2}'.format(fullText,
unit.unitString(None, swap),
unit.parenthClosed and ')' or '')
firstUnit = False
return fullText
def groupValid(self):
"""Return True if all units are valid.
"""
if not self.unitList or not self.parenthClosed:
return False
for unit in self.unitList:
if hasattr(unit, 'unitValid'):
if not unit.unitValid():
return False
else:
if not unit.groupValid():
return False
return True
def reduceGroup(self):
"""Update reduced list of units and factor.
"""
self.linear = True
self.reducedList = []
self.factor = 1.0
if not self.groupValid():
return
count = 0
tmpList = self.flatUnitList()
while tmpList:
count += 1
if count > 5000:
raise unitdata.UnitDataError(_('Circular unit definition'))
unit = tmpList.pop(0)
if unit.equiv.startswith('!'):
self.reducedList.append(unit.copy())
elif not unit.equiv:
raise unitdata.UnitDataError(_('Invalid conversion for "{0}"').
format(unit.name))
else:
if unit.fromEqn:
self.linear = False
equivUnit = UnitGroup(self.unitData, self.option)
equivUnit.update(unit.equiv)
newList = equivUnit.flatUnitList()
for newUnit in newList:
newUnit.exp *= unit.exp
tmpList.extend(newList)
self.factor *= unit.factor**unit.exp
self.reducedList.sort()
tmpList = self.reducedList[:]
self.reducedList = []
for unit in tmpList:
if self.reducedList and unit == self.reducedList[-1]:
self.reducedList[-1].exp += unit.exp
else:
self.reducedList.append(unit)
self.reducedList = [unit for unit in self.reducedList if
unit.equiv != '!!' and unit.name != 'unit' and
unit.exp != 0]
def categoryMatch(self, otherGroup):
"""Return True if unit types are equivalent.
"""
if not self.checkLinear() or not otherGroup.checkLinear():
return False
return self.reducedList == otherGroup.reducedList and \
[unit.exp for unit in self.reducedList] == \
[unit.exp for unit in otherGroup.reducedList]
def checkLinear(self):
"""Return True if linear or acceptable non-linear.
"""
if not self.linear:
flatList = self.flatUnitList()
if len(flatList) > 1 or flatList[0].exp != 1:
return False
return True
def compatStr(self):
"""Return string with reduced unit or linear compatability problem.
"""
if self.checkLinear():
return self.unitString(self.reducedList)
return _('Cannot combine non-linear units')
def convert(self, num, toGroup):
"""Return num of this group converted to toGroup.
"""
if self.linear:
num *= self.factor
else:
num = self.nonLinearCalc(num, 1) * self.factor
if toGroup.linear:
return num / toGroup.factor
return toGroup.nonLinearCalc(num / toGroup.factor, 0)
def nonLinearCalc(self, num, isFrom):
"""Return result of non-linear calculation.
"""
x = num
try:
unit = self.flatUnitList()[0]
if unit.toEqn: # regular equations
if isFrom:
return float(eval(unit.fromEqn))
return float(eval(unit.toEqn))
data = list(eval(unit.fromEqn)) # extrapolation list
if isFrom:
data = [(float(group[0]), float(group[1])) for group in data]
else:
data = [(float(group[1]), float(group[0])) for group in data]
data.sort()
pos = len(data) - 1
for i in range(len(data)):
if num <= data[i][0]:
pos = i
break
if pos == 0:
pos = 1
return ((num-data[pos-1][0]) / float(data[pos][0]-data[pos-1][0]) *
(data[pos][1]-data[pos-1][1]) + data[pos-1][1])
except OverflowError:
return 1e9999
except:
raise unitdata.UnitDataError(_('Bad equation for {0}').
format(unit.name))
def convertStr(self, num, toGroup):
"""Return formatted string of converted number.
"""
return self.formatNumStr(self.convert(num, toGroup))
def formatNumStr(self, num):
"""Return num string formatted per options.
"""
decPlcs = self.option.intData('DecimalPlaces', 0, UnitGroup.maxDecPlcs)
if self.option.boolData('SciNotation'):
return '{0:0.{prec}E}'.format(num, prec = decPlcs)
if self.option.boolData('FixedDecimals'):
return '{0:0.{prec}f}'.format(num, prec = decPlcs)
return '{0:0.{prec}G}'.format(num, prec = decPlcs)
if __name__ == '__main__':
import unitdata
import option
options = option.Option('convertall', 20)
options.loadAll(["DecimalPlaces 8",
"SciNotation no",
"FixedDecimals no"])
data = unitdata.UnitData()
data.readData()
fromText = input('Enter from unit -> ')
fromUnit = UnitGroup(data, options)
fromUnit.update(fromText)
toText = input('Enter to unit -> ')
toUnit = UnitGroup(data, options)
toUnit.update(toText)
print('{0} TO {1}'.format(fromUnit.unitString(), toUnit.unitString()))
fromUnit.reduceGroup()
toUnit.reduceGroup()
print('{0} TO {1}'.format(fromUnit.unitString(fromUnit.reducedList),
toUnit.unitString(toUnit.reducedList)))
if not fromUnit.categoryMatch(toUnit):
print('NO MATCH')
else:
print('MATCH')
numText = input('Enter value -> ')
num = float(numText)
print('{0} IS {1}'.format(num, fromUnit.convert(num, toUnit)))
ConvertAll/source/numedit.py 0000644 0001750 0001750 00000011454 12271233216 015130 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# numedit.py, provides a number entry editor
#
# ConvertAll, a units conversion program
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
import re
import sys
from PyQt4 import QtCore, QtGui
import unitdata
class NumEdit(QtGui.QLineEdit):
"""Number entry editor.
"""
convertRqd = QtCore.pyqtSignal()
convertNum = QtCore.pyqtSignal(str)
def __init__(self, thisUnit, otherUnit, label, status, recentUnits,
primary, parent=None):
QtGui.QLineEdit.__init__(self, parent)
self.thisUnit = thisUnit
self.otherUnit = otherUnit
self.label = label
self.status = status
self.recentUnits = recentUnits
self.primary = primary
self.onLeft = primary
self.setValidator(FloatExprValidator(self))
self.setText(self.thisUnit.formatNumStr(1.0))
self.textEdited.connect(self.convert)
def unitUpdate(self):
"""Update the editor and labels based on a unit change.
"""
if self.thisUnit.groupValid():
self.label.setTitle(self.thisUnit.unitString())
if self.otherUnit.groupValid():
try:
self.thisUnit.reduceGroup()
self.otherUnit.reduceGroup()
except unitdata.UnitDataError as text:
QtGui.QMessageBox.warning(self, 'ConvertAll',
_('Error in unit data - {0}').
format(text))
return
if self.thisUnit.categoryMatch(self.otherUnit):
self.status.setText(_('Converting...'))
if self.primary:
self.convert()
else:
self.convertRqd.emit()
return
if self.onLeft:
self.status.setText(_('Units are not compatible '
'({0} vs. {1})').
format(self.thisUnit.compatStr(),
self.otherUnit.compatStr()))
else:
self.status.setText(_('Units are not compatible '
'({0} vs. {1})').
format(self.otherUnit.compatStr(),
self.thisUnit.compatStr()))
else:
self.status.setText(_('Set units'))
else:
self.status.setText(_('Set units'))
self.label.setTitle(_('No Unit Set'))
self.setEnabled(False)
self.convertNum.emit('')
def convert(self):
"""Do conversion with self primary.
"""
self.primary = True
self.setEnabled(True)
if self.onLeft:
self.recentUnits.addEntry(self.otherUnit.unitString())
self.recentUnits.addEntry(self.thisUnit.unitString())
else:
self.recentUnits.addEntry(self.thisUnit.unitString())
self.recentUnits.addEntry(self.otherUnit.unitString())
try:
num = float(eval(self.text()))
except:
self.convertNum.emit('')
return
try:
numText = self.thisUnit.convertStr(num, self.otherUnit)
self.convertNum.emit(numText)
except unitdata.UnitDataError as text:
QtGui.QMessageBox.warning(self, 'ConvertAll',
_('Error in unit data - {0}').
format(text))
def setNum(self, numText):
"""Set text based on conversion from other number editor.
"""
if not numText:
self.setEnabled(False)
else:
self.primary = False
self.setEnabled(True)
self.setText(numText)
class FloatExprValidator(QtGui.QValidator):
"""Validator for float python expressions typed into NumEdit.
"""
invalidRe = re.compile(r'[^\d\.eE\+\-\*/\(\)]')
def __init__(self, parent):
QtGui.QValidator.__init__(self, parent)
def validate(self, inputStr, pos):
"""Check for valid characters in entry.
"""
if FloatExprValidator.invalidRe.search(inputStr):
return (QtGui.QValidator.Invalid, inputStr, pos)
return (QtGui.QValidator.Acceptable, inputStr, pos)
ConvertAll/source/modbutton.py 0000644 0001750 0001750 00000002711 12270342155 015474 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# modbutton.py, provides a button that signals its text
#
# ConvertAll, a units conversion program
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
from PyQt4 import QtCore, QtGui
class ModButton(QtGui.QPushButton):
"""Button used to add operators, change exponent or clear unit.
"""
stateChg = QtCore.pyqtSignal()
def __init__(self, function, param, label, parent=None):
QtGui.QPushButton.__init__(self, label, parent)
self.function = function
self.param = param
self.setFocusPolicy(QtCore.Qt.NoFocus)
self.clicked.connect(self.exe)
def exe(self):
"""Execute function on button push.
"""
if self.param != None:
self.function(self.param)
else:
self.function()
self.stateChg.emit() # update listView
def sizeHint(self):
"""Adjust width smaller.
"""
size = QtGui.QPushButton.sizeHint(self)
size.setWidth(size.width() / 2)
return size
ConvertAll/source/unitlistview.py 0000644 0001750 0001750 00000010624 12270342155 016231 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# unitlistview.py, provides a list view of available units
#
# ConvertAll, a units conversion program
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
from PyQt4 import QtCore, QtGui
import convertdlg
class UnitListView(QtGui.QTreeWidget):
"""ListView of units available.
"""
unitChanged = QtCore.pyqtSignal()
def __init__(self, unitGroup, unitRefNum, parent=None):
QtGui.QTreeWidget.__init__(self, parent)
self.unitGroup = unitGroup
self.unitRefNum = unitRefNum
self.buttonList = []
self.setRootIsDecorated(False)
self.setColumnCount(3)
self.setHeaderLabels([_('Unit Name'), _('Unit Type'), _('Comments')])
self.header().setStretchLastSection(False)
self.itemSelectionChanged.connect(self.replaceUnit)
self.loadUnits()
def loadUnits(self):
"""Load unit items.
"""
self.clear()
for name in convertdlg.ConvertDlg.unitData.sortedKeys:
UnitListViewItem(convertdlg.ConvertDlg.unitData[name],
self.unitRefNum, self)
for col in range(3):
self.resizeColumnToContents(col)
def relayChange(self):
"""Update list after buttons changed the unit group.
"""
self.updateSelection()
self.setFocus()
self.unitChanged.emit() # update unitEdit
def updateSelection(self):
"""Update list after change to line editor.
"""
self.blockSignals(True)
self.enableButtons(True)
self.clearSelection()
unit = self.unitGroup.currentUnit()
if unit and unit.equiv:
self.setCurrentItem(unit.viewLink[self.unitRefNum])
self.setItemSelected(unit.viewLink[self.unitRefNum], True)
else:
unit = self.unitGroup.currentPartialUnit()
if unit:
self.setCurrentItem(unit.viewLink[self.unitRefNum])
self.setItemSelected(unit.viewLink[self.unitRefNum], False)
else:
unit = self.unitGroup.currentSortPos()
self.enableButtons(False)
self.scrollToCenter(unit)
self.blockSignals(False)
def replaceUnit(self):
"""Replace current unit in response to a selection change.
"""
selectList = self.selectedItems()
if selectList:
selection = selectList[-1]
self.unitGroup.replaceCurrent(selection.unit)
self.unitChanged.emit() # update unitEdit
self.enableButtons(True)
def enableButtons(self, enable=True):
"""Enable unit modification buttons for valid unit.
"""
for button in self.buttonList:
button.setEnabled(enable)
def scrollToCenter(self, unit):
"""Scroll so given unit is in the center of the viewport.
"""
unitItem = unit.viewLink[self.unitRefNum]
index = self.indexOfTopLevelItem(unitItem)
itemHeight = self.visualItemRect(unitItem).height()
viewHeight = self.viewport().height()
bottomIndex = index + viewHeight / (2 * itemHeight)
bottomItem = self.topLevelItem(bottomIndex)
if not bottomItem:
bottomItem = self.topLevelItem(self.topLevelItemCount() - 1)
self.scrollToItem(bottomItem, QtGui.QAbstractItemView.PositionAtBottom)
def sizeHint(self):
"""Adjust width smaller.
"""
size = QtGui.QTreeWidget.sizeHint(self)
size.setWidth(self.columnWidth(0) + self.columnWidth(1) +
self.verticalScrollBar().sizeHint().width())
return size
class UnitListViewItem(QtGui.QTreeWidgetItem):
"""Item in list view, references unit.
"""
def __init__(self, unit, unitRefNum, parent=None):
QtGui.QTreeWidgetItem.__init__(self, parent)
self.unit = unit
unit.viewLink[unitRefNum] = self
self.setText(0, unit.description())
self.setText(1, unit.typeName)
self.setText(2, unit.comments[1])
ConvertAll/source/unitdata.py 0000644 0001750 0001750 00000010502 12270342155 015267 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# unitdata.py, reads unit data from file
#
# ConvertAll, a units conversion program
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
import sys
import os.path
try:
from __main__ import dataFilePath, lang
except ImportError:
dataFilePath = None
lang = ''
import unitatom
class UnitDataError(Exception):
"""General exception for unit data problems.
"""
pass
class UnitData(dict):
"""Reads unit data nad stores in a dictionary based on unit name.
"""
def __init__(self):
dict.__init__(self)
self.sortedKeys = []
self.typeList = []
def findDataFile(self):
"""Search for data file, return line list or None.
"""
modPath = os.path.abspath(sys.path[0])
if modPath.endswith('.zip'): # for py2exe
modPath = os.path.dirname(modPath)
pathList = [dataFilePath, os.path.join(modPath, '../data/'), modPath]
fileList = ['units.dat']
if lang and lang != 'C':
fileList[0:0] = ['units_{0}.dat'.format(lang),
'units_{0}.dat'.format(lang[:2])]
for path in pathList:
if path:
for fileName in fileList:
try:
with open(os.path.join(path, fileName), 'r',
encoding='utf-8') as f:
lineList = f.readlines()
return lineList
except IOError:
pass
raise UnitDataError(_('Can not read "units.dat" file'))
def readData(self):
"""Read all unit data from file, return number loaded.
"""
lines = self.findDataFile()
for i in range(len(lines)): # join continuation lines
delta = 1
while lines[i].rstrip().endswith('\\'):
lines[i] = ''.join([lines[i].rstrip()[:-1], lines[i+delta]])
lines[i+delta] = ''
delta += 1
units = [unitatom.UnitAtom(line) for line in lines if
line.split('#', 1)[0].strip()] # remove comment lines
typeText = ''
for unit in units: # find & set headings
if unit.name.startswith('['):
typeText = unit.name[1:-1].strip()
self.typeList.append(typeText)
unit.typeName = typeText
units = [unit for unit in units if unit.equiv] # keep valid units
for unit in units:
self[unit.name.lower().replace(' ', '')] = unit
self.sortedKeys = list(self.keys())
self.sortedKeys.sort()
if len(self.sortedKeys) < len(units):
raise UnitDataError(_('Duplicate unit names found'))
return len(units)
def findPartialMatch(self, text):
"""Return first partially matching unit or None.
"""
text = text.lower().replace(' ', '')
if not text:
return None
for name in self.sortedKeys:
if name.startswith(text):
return self[name]
return None
def findSortPos(self, text):
"""Return unit whose abbrev comes immediately after text.
"""
text = text.lower().replace(' ', '')
for name in self.sortedKeys:
if text <= name:
return self[name]
return self[self.sortedKeys[-1]]
def filteredList(self, type='', srchStr=''):
"""Return list of units matching type and search string,
if given.
"""
units = list(self.values())
if type:
units = [unit for unit in units if unit.typeName == type]
if srchStr.strip():
srchWords = [word.lower() for word in srchStr.split()]
srchUnits = []
for unit in units:
if unit.matchWords(srchWords):
srchUnits.append(unit)
units = srchUnits
return units
ConvertAll/source/cmdline.py 0000644 0001750 0001750 00000015711 12270342155 015100 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# cmdline.py, provides a class to read and execute command line arguments
#
# ConvertAll, a units conversion program
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
import sys
import re
import option
import optiondefaults
import unitdata
import unitgroup
usage = [_('Usage:'),
'',
' convertall [{0}]'.format(_('qt-options')),
'',
_('-or- (non-GUI):'),
' convertall [{0}] [{1}] {2} [{3}]'.format(_('options'),
_('number'),
_('from_unit'),
_('to_unit')),
'',
_('-or- (non-GUI):'),
' convertall -i [{0}]'.format(_('options')),
'',
_('Units with spaces must be "quoted"'),
'',
_('Options:'),
' -d, --decimals={0:6} {1}'.format(_('num'),
_('set number of decimals to show')),
' -f, --fixed-decimals {0}'.format(
_('show set number of decimals, even if zeros')),
' -h, --help {0}'.format(
_('display this message and exit')),
' -i, --interactive {0}'.format(
_('interactive command line mode (non-GUI)')),
' -q, --quiet {0}'.format(
_('convert without further prompts')),
' -s, --sci-notation {0}'.format(
_('show results in scientific notation')),
'']
def parseArgs(opts, args):
"""Parse the command line and output conversion results.
"""
options = option.Option('convertall', 20)
options.loadAll(optiondefaults.defaultList)
quiet = False
dataTestMode = False
for opt, arg in opts:
if opt in ('-h', '--help'):
printUsage()
return
if opt in ('-d', '--decimals'):
try:
decimals = int(arg)
if 0 <= decimals <= unitgroup.UnitGroup.maxDecPlcs:
options.changeData('DecimalPlaces', arg, False)
except ValueError:
pass
elif opt in ('-f', '--fixed-decimals'):
options.changeData('FixedDecimals', 'yes', False)
elif opt in ('-s', '--sci-notation'):
options.changeData('SciNotation', 'yes', False)
elif opt in ('-q', '--quiet'):
quiet = True
elif opt in ('-t', '--test'):
dataTestMode = True
data = unitdata.UnitData()
try:
data.readData()
except unitdata.UnitDataError as text:
print('Error in unit data - {0}'.format(text))
sys.exit(1)
if dataTestMode:
unitDataTest(data, options)
return
numStr = '1.0'
if args:
numStr = args[0]
try:
float(numStr)
del args[0]
except (ValueError):
numStr = '1.0'
fromUnit = None
try:
fromUnit = getUnit(data, options, args.pop(0))
except IndexError:
pass
if not fromUnit and quiet:
return
toUnit = None
try:
toUnit = getUnit(data, options, args[0])
except IndexError:
pass
if not toUnit and quiet:
return
while True:
while not fromUnit:
text = _('Enter from unit -> ')
fromText = input(text)
if not fromText:
return
fromUnit = getUnit(data, options, fromText)
while not toUnit:
text = _('Enter to unit -> ')
toText = input(text)
if not toText:
return
toUnit = getUnit(data, options, toText)
if fromUnit.categoryMatch(toUnit):
badEntry = False
while True:
if not badEntry:
newNumStr = fromUnit.convertStr(float(numStr), toUnit)
print('{0} {1} = {2} {3}'.format(numStr,
fromUnit.unitString(),
newNumStr,
toUnit.unitString()))
if quiet:
return
badEntry = False
text = _('Enter number, [n]ew, [r]everse or [q]uit -> ')
rep = input(text)
if not rep or rep[0] in ('q', 'Q'):
return
if rep[0] in ('r', 'R'):
fromUnit, toUnit = toUnit, fromUnit
elif rep[0] in ('n', 'N'):
fromUnit = None
toUnit = None
numStr = '1.0'
print()
break
else:
try:
float(rep)
numStr = rep
except ValueError:
badEntry = True
else:
print(_('Units {0} and {1} are not compatible').
format(fromUnit.unitString(), toUnit.unitString()))
if quiet:
return
fromUnit = None
toUnit = None
def getUnit(data, options, text):
"""Create unit from text, check unit is valid,
return reduced unit or None.
"""
unit = unitgroup.UnitGroup(data, options)
unit.update(text)
if unit.groupValid():
unit.reduceGroup()
return unit
print(_('{0} is not a valid unit').format(text))
return None
def printUsage():
"""Print usage text.
"""
print('\n'.join(usage))
def unitDataTest(data, options):
"""Run through a test of all units for consistent definitions,
print results, return True if all pass.
"""
badUnits = {}
errorRegEx = re.compile(r'.*"(.*)"$')
for unit in data.values():
if not unit.unitValid():
badUnits.setdefault(unit.name, []).append(unit.name)
group = unitgroup.UnitGroup(data, options)
group.replaceCurrent(unit)
try:
group.reduceGroup()
except unitdata.UnitDataError as errorText:
rootUnitName = errorRegEx.match(errorText).group(1)
badUnits.setdefault(rootUnitName, []).append(unit.name)
if not badUnits:
print('All units pass tests')
return True
for key in sorted(badUnits.keys()):
impacts = ', '.join(sorted(badUnits[key]))
print('{0}\n Impacts: {1}\n'.format(key, impacts))
return False
ConvertAll/source/convertdlg.py 0000644 0001750 0001750 00000045550 12272333500 015634 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# convertdlg.py, provides the main dialog and GUI interface
#
# ConvertAll, a units conversion program
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
import sys
import os.path
from PyQt4 import QtCore, QtGui
try:
from __main__ import __version__, __author__, helpFilePath, iconPath
from __main__ import lang
except ImportError:
__version__ = __author__ = '??'
helpFilePath = None
iconPath = None
lang = ''
import unitdata
from unitgroup import UnitGroup
from option import Option
import recentunits
import unitedit
import unitlistview
import numedit
from modbutton import ModButton
import finddlg
import icondict
import optiondefaults
import helpview
import optiondlg
class ConvertDlg(QtGui.QWidget):
"""Main dialog for ConvertAll program.
"""
unitData = unitdata.UnitData()
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.setWindowTitle('ConvertAll')
modPath = os.path.abspath(sys.path[0])
if modPath.endswith('.zip'): # for py2exe
modPath = os.path.dirname(modPath)
iconPathList = [iconPath, os.path.join(modPath, 'icons/'),
os.path.join(modPath, '../icons')]
self.icons = icondict.IconDict()
self.icons.addIconPath([path for path in iconPathList if path])
try:
QtGui.QApplication.setWindowIcon(self.icons['convertall_med'])
except KeyError:
pass
self.helpView = None
self.findDlg = None
self.option = Option('convertall', 20)
self.option.loadAll(optiondefaults.defaultList)
self.recentUnits = recentunits.RecentUnits(self.option)
try:
num = ConvertDlg.unitData.readData()
except unitdata.UnitDataError as text:
QtGui.QMessageBox.warning(self, 'ConvertAll',
_('Error in unit data - {0}').
format(text))
sys.exit(1)
print(_('{0} units loaded').format(num))
self.fromGroup = UnitGroup(ConvertDlg.unitData, self.option)
self.toGroup = UnitGroup(ConvertDlg.unitData, self.option)
self.origPal = QtGui.QApplication.palette()
self.updateColors()
self.textButtons = []
self.recentButtons = []
topLayout = QtGui.QHBoxLayout(self) # divide main, buttons
mainLayout = QtGui.QVBoxLayout()
topLayout.addLayout(mainLayout)
unitLayout = QtGui.QHBoxLayout() # unit selection
mainLayout.addLayout(unitLayout)
fromBox = QtGui.QGroupBox(_('From Unit'))
unitLayout.addWidget(fromBox)
fromLayout = QtGui.QVBoxLayout(fromBox)
fromLayout.setSpacing(3)
self.fromUnitEdit = unitedit.UnitEdit(self.fromGroup)
fromLayout.addWidget(self.fromUnitEdit)
self.fromUnitEdit.setFocus()
self.fromUnitListView = unitlistview.UnitListView(self.fromGroup, 0)
fromLayout.addWidget(self.fromUnitListView)
self.fromUnitEdit.currentChanged.connect(self.fromUnitListView.
updateSelection)
self.fromUnitListView.unitChanged.connect(self.fromUnitEdit.unitUpdate)
self.fromUnitListView.setFocusProxy(self.fromUnitEdit)
self.addButtons(self.fromGroup, self.fromUnitListView, fromLayout)
toBox = QtGui.QGroupBox(_('To Unit'))
unitLayout.addWidget(toBox)
toLayout = QtGui.QVBoxLayout(toBox)
toLayout.setSpacing(3)
self.toUnitEdit = unitedit.UnitEdit(self.toGroup)
toLayout.addWidget(self.toUnitEdit)
self.toUnitListView = unitlistview.UnitListView(self.toGroup, 1)
toLayout.addWidget(self.toUnitListView)
self.toUnitEdit.currentChanged.connect(self.toUnitListView.
updateSelection)
self.toUnitListView.unitChanged.connect(self.toUnitEdit.unitUpdate)
self.toUnitListView.setFocusProxy(self.toUnitEdit)
self.addButtons(self.toGroup, self.toUnitListView, toLayout)
self.showHideButtons()
numberLayout = QtGui.QHBoxLayout()
mainLayout.addLayout(numberLayout)
statusLabel = QtGui.QLabel(_('Set units'))
statusLabel.setFrameStyle(QtGui.QFrame.Panel | QtGui.QFrame.Sunken)
mainLayout.addWidget(statusLabel)
fromNumBox = QtGui.QGroupBox(_('No Unit Set'))
numberLayout.addWidget(fromNumBox)
fromNumLayout = QtGui.QVBoxLayout(fromNumBox)
self.fromNumEdit = numedit.NumEdit(self.fromGroup, self.toGroup,
fromNumBox, statusLabel,
self.recentUnits, True)
fromNumLayout.addWidget(self.fromNumEdit)
self.fromUnitEdit.unitChanged.connect(self.fromNumEdit.unitUpdate)
self.fromNumEdit.setEnabled(False)
equalsLabel = QtGui.QLabel(' = ')
equalsLabel.setFont(QtGui.QFont(self.font().family(), 30))
numberLayout.addWidget(equalsLabel)
toNumBox = QtGui.QGroupBox(_('No Unit Set'))
numberLayout.addWidget(toNumBox)
toNumLayout = QtGui.QVBoxLayout(toNumBox)
self.toNumEdit = numedit.NumEdit(self.toGroup, self.fromGroup,
toNumBox, statusLabel,
self.recentUnits, False)
toNumLayout.addWidget(self.toNumEdit)
self.toUnitEdit.unitChanged.connect(self.toNumEdit.unitUpdate)
self.toNumEdit.setEnabled(False)
self.fromNumEdit.convertNum.connect(self.toNumEdit.setNum)
self.toNumEdit.convertNum.connect(self.fromNumEdit.setNum)
self.fromNumEdit.convertNum.connect(self.setRecentAvail)
self.toNumEdit.convertNum.connect(self.setRecentAvail)
self.fromNumEdit.convertRqd.connect(self.toNumEdit.convert)
self.toNumEdit.convertRqd.connect(self.fromNumEdit.convert)
buttonLayout = QtGui.QVBoxLayout() # major buttons
topLayout.addLayout(buttonLayout)
closeButton = QtGui.QPushButton(_('&Close'))
buttonLayout.addWidget(closeButton)
closeButton.setFocusPolicy(QtCore.Qt.NoFocus)
closeButton.clicked.connect(self.close)
finderButton = QtGui.QPushButton(_('&Unit Finder...'))
buttonLayout.addWidget(finderButton)
finderButton.setFocusPolicy(QtCore.Qt.NoFocus)
finderButton.clicked.connect(self.showFinder)
optionsButton = QtGui.QPushButton(_('&Options...'))
buttonLayout.addWidget(optionsButton)
optionsButton.setFocusPolicy(QtCore.Qt.NoFocus)
optionsButton.clicked.connect(self.changeOptions)
helpButton = QtGui.QPushButton(_('&Help...'))
buttonLayout.addWidget(helpButton)
helpButton.setFocusPolicy(QtCore.Qt.NoFocus)
helpButton.clicked.connect(self.help)
aboutButton = QtGui.QPushButton(_('&About...'))
buttonLayout.addWidget(aboutButton)
aboutButton.setFocusPolicy(QtCore.Qt.NoFocus)
aboutButton.clicked.connect(self.about)
buttonLayout.addStretch()
xSize = self.option.intData('MainDlgXSize', 0, 10000)
ySize = self.option.intData('MainDlgYSize', 0, 10000)
if xSize and ySize:
self.resize(xSize, ySize)
self.move(self.option.intData('MainDlgXPos', 0, 10000),
self.option.intData('MainDlgYPos', 0, 10000))
if self.option.boolData('LoadLastUnit') and len(self.recentUnits) > 1:
self.fromGroup.update(self.recentUnits[0])
self.fromUnitEdit.unitUpdate()
self.fromUnitListView.updateSelection()
self.toGroup.update(self.recentUnits[1])
self.toUnitEdit.unitUpdate()
self.toUnitListView.updateSelection()
self.fromNumEdit.setFocus()
self.fromNumEdit.selectAll()
if self.option.boolData('ShowStartupTip'):
self.show()
tipDialog = TipDialog(self.option, self)
tipDialog.exec_()
def addButtons(self, unitGroup, listView, upperLayout):
"""Add buttons to unit selector.
"""
buttonLayout = QtGui.QHBoxLayout()
upperLayout.addLayout(buttonLayout)
buttons = []
buttons.append(ModButton(unitGroup.addOper, 1, 'X'))
buttons.append(ModButton(unitGroup.addOper, 0, '/'))
buttons.append(ModButton(unitGroup.changeExp, 2, '^2'))
buttons.append(ModButton(unitGroup.changeExp, 3, '^3'))
for button in buttons:
buttonLayout.addWidget(button)
listView.buttonList = buttons[:]
buttons.append(ModButton(unitGroup.clearUnit, None, _('Clear Unit')))
extraLayout = QtGui.QHBoxLayout()
upperLayout.addLayout(extraLayout)
extraLayout.addWidget(buttons[-1])
for but in buttons:
but.stateChg.connect(listView.relayChange)
but.setEnabled(False)
self.textButtons.append(but)
buttons[-1].setEnabled(True)
recentButton = QtGui.QPushButton(_('Recent Unit'))
recentButton.setFocusPolicy(QtCore.Qt.NoFocus)
recentButton.unitGroup = unitGroup
recentButton.clicked.connect(self.recentMenu)
extraLayout.addWidget(recentButton)
self.textButtons.append(recentButton)
self.recentButtons.append(recentButton)
self.setRecentAvail()
def recentMenu(self):
"""Show a menu with recently used units.
"""
button = self.sender()
menu = QtGui.QMenu()
for unit in self.recentUnits:
action = menu.addAction(unit)
action.unitGroup = button.unitGroup
menu.triggered.connect(self.insertRecent)
menu.exec_(button.mapToGlobal(QtCore.QPoint(0, 0)))
def setRecentAvail(self):
"""Enable or disable recent unit button.
"""
for button in self.recentButtons:
button.setEnabled(len(self.recentUnits))
def insertRecent(self, action):
"""Insert the recent unit from the given action.
"""
action.unitGroup.update(action.text())
if action.unitGroup is self.fromGroup:
self.fromUnitEdit.unitUpdate()
self.fromUnitListView.updateSelection()
else:
self.toUnitEdit.unitUpdate()
self.toUnitListView.updateSelection()
def updateColors(self):
"""Adjust the colors to the current option settings.
"""
if self.option.boolData('UseDefaultColors'):
pal = self.origPal
else:
pal = QtGui.QPalette()
pal.setColor(QtGui.QPalette.Base,
self.getOptionColor('Background'))
pal.setColor(QtGui.QPalette.Text,
self.getOptionColor('Foreground'))
QtGui.QApplication.setPalette(pal)
def showFinder(self):
"""Show dialog for searhing and filtering units.
"""
if not self.findDlg:
self.findDlg = finddlg.FindDlg(self)
self.findDlg.show()
def changeOptions(self):
"""Show dialog for option changes.
"""
origBackground = self.getOptionColor('Background')
origForeground = self.getOptionColor('Foreground')
dlg = optiondlg.OptionDlg(self.option, self)
dlg.startGroupBox(_('Result Display'))
optiondlg.OptionDlgInt(dlg, 'DecimalPlaces', _('Decimal places'),
0, UnitGroup.maxDecPlcs)
optiondlg.OptionDlgBool(dlg, 'SciNotation',
_('Use scientific notation'))
optiondlg.OptionDlgBool(dlg, 'FixedDecimals',
_('Use fixed decimal places'))
dlg.startGroupBox(_('Recent Units'))
optiondlg.OptionDlgInt(dlg, 'RecentUnits', _('Number saved'), 2, 99)
optiondlg.OptionDlgBool(dlg, 'LoadLastUnit',
_('Load last units at startup'))
dlg.startGroupBox(_('User Interface'))
optiondlg.OptionDlgBool(dlg, 'ShowOpButtons',
_('Show operator buttons'))
optiondlg.OptionDlgBool(dlg, 'ShowStartupTip',
_('Show tip at startup'))
dlg.startGroupBox(_('Colors'))
optiondlg.OptionDlgBool(dlg, 'UseDefaultColors',
_('Use default system colors'))
optiondlg.OptionDlgPush(dlg, _('Set background color'), self.backColor)
optiondlg.OptionDlgPush(dlg, _('Set text color'), self.textColor)
if dlg.exec_() == QtGui.QDialog.Accepted:
self.option.writeChanges()
self.recentUnits.updateQuantity()
self.updateColors()
self.showHideButtons()
self.fromNumEdit.unitUpdate()
self.toNumEdit.unitUpdate()
else:
self.setOptionColor('Background', origBackground)
self.setOptionColor('Foreground', origForeground)
def getOptionColor(self, rootName):
"""Return a color from option storage.
"""
return QtGui.QColor(self.option.intData(rootName + 'R', 0, 255),
self.option.intData(rootName + 'G', 0, 255),
self.option.intData(rootName + 'B', 0, 255))
def setOptionColor(self, rootName, color):
"""Store given color in options.
"""
self.option.changeData(rootName + 'R', repr(color.red()), True)
self.option.changeData(rootName + 'G', repr(color.green()), True)
self.option.changeData(rootName + 'B', repr(color.blue()), True)
def backColor(self):
"""Allow user to set control background color.
"""
background = self.getOptionColor('Background')
newColor = QtGui.QColorDialog.getColor(background, self)
if newColor.isValid() and newColor != background:
self.setOptionColor('Background', newColor)
def textColor(self):
"""Allow user to set control text color.
"""
foreground = self.getOptionColor('Foreground')
newColor = QtGui.QColorDialog.getColor(foreground, self)
if newColor.isValid() and newColor != foreground:
self.setOptionColor('Foreground', newColor)
def showHideButtons(self):
"""Show or hide text modify buttons.
"""
visible = self.option.boolData('ShowOpButtons')
for button in self.textButtons:
if visible:
button.show()
else:
button.hide()
def findHelpFile(self):
"""Return the path to the help file.
"""
modPath = os.path.abspath(sys.path[0])
if modPath.endswith('.zip'): # for py2exe
modPath = os.path.dirname(modPath)
pathList = [helpFilePath, os.path.join(modPath, '../doc/'),
modPath, os.path.join(modPath, 'doc/')]
fileList = ['README.html']
if lang and lang != 'C':
fileList[0:0] = ['README_{0}.html'.format(lang),
'README_{0}.html'.format(lang[:2])]
for path in [path for path in pathList if path]:
for fileName in fileList:
fullPath = os.path.join(path, fileName)
if os.access(fullPath, os.R_OK):
return fullPath
return ''
def help(self):
"""View the ReadMe file.
"""
if not self.helpView:
path = self.findHelpFile()
if not path:
QtGui.QMessageBox.warning(self, 'ConvertAll',
_('Read Me file not found'))
return
self.helpView = helpview.HelpView(path,
_('ConvertAll README File'),
self.icons)
self.helpView.show()
def about(self):
"""Show about info.
"""
QtGui.QMessageBox.about(self, 'ConvertAll',
_('ConvertAll Version {0}\nby {1}').
format(__version__, __author__))
def closeEvent(self, event):
"""Save window data on close.
"""
self.option.changeData('MainDlgXSize', self.width(), True)
self.option.changeData('MainDlgYSize', self.height(), True)
self.option.changeData('MainDlgXPos', self.x(), True)
self.option.changeData('MainDlgYPos', self.y(), True)
if self.findDlg:
self.option.changeData('FinderXSize', self.findDlg.width(), True)
self.option.changeData('FinderYSize', self.findDlg.height(), True)
self.option.changeData('FinderXPos', self.findDlg.x(), True)
self.option.changeData('FinderYPos', self.findDlg.y(), True)
self.recentUnits.writeList()
self.option.writeChanges()
event.accept()
class TipDialog(QtGui.QDialog):
"""Show a static usage tip at startup by default.
"""
def __init__(self, option, parent=None):
QtGui.QDialog.__init__(self, parent)
self.option = option
self.setWindowFlags(QtCore.Qt.Dialog | QtCore.Qt.WindowTitleHint |
QtCore.Qt.WindowSystemMenuHint)
self.setWindowTitle(_('Convertall - Tip'))
topLayout = QtGui.QVBoxLayout(self)
self.setLayout(topLayout)
box = QtGui.QGroupBox(_('Combining Units'))
topLayout.addWidget(box)
boxLayout = QtGui.QVBoxLayout(box)
label = QtGui.QLabel(self)
label.setTextFormat(QtCore.Qt.RichText)
label.setText(_('
ConvertAll\'s strength is the ability to combine '
'units:
'
'
Enter "m/s" to get meters per second
'
'
Enter "ft*lbf" to get foot-pounds (torque)
'
'
Enter "in^2" to get square inches
'
'
Enter "m^3" to get cubic meters
'
'
or any other combinations you can imagine
'
'
'))
boxLayout.addWidget(label)
ctrlLayout = QtGui.QHBoxLayout()
topLayout.addLayout(ctrlLayout)
self.showCheck = QtGui.QCheckBox(_('Show this tip at startup'), self)
self.showCheck.setChecked(True)
ctrlLayout.addWidget(self.showCheck)
ctrlLayout.addStretch()
okButton = QtGui.QPushButton(_('&OK'), self)
ctrlLayout.addWidget(okButton)
okButton.clicked.connect(self.accept)
def accept(self):
"""Called by dialog when OK button pressed.
"""
if not self.showCheck.isChecked():
self.option.changeData('ShowStartupTip', 'no', True)
QtGui.QDialog.accept(self)
ConvertAll/source/convertall.pro 0000644 0001750 0001750 00000001004 12271706662 016004 0 ustar doug doug SOURCES = cmdline.py \
convertall.py \
convertdlg.py \
finddlg.py \
helpview.py \
icondict.py \
modbutton.py \
numedit.py \
optiondefaults.py \
optiondlg.py \
option.py \
setup.py \
unitatom.py \
unitdata.py \
unitedit.py \
unitgroup.py \
unitlistview.py
TRANSLATIONS = convertall_es.ts \
convertall_de.ts \
convertall_fr.ts
ConvertAll/source/finddlg.py 0000644 0001750 0001750 00000017671 12271312645 015105 0 ustar doug doug #!/usr/bin/env python3
#****************************************************************************
# finddlg.py, provides dialog interface for unit find dialog
#
# ConvertAll, a units conversion program
# Copyright (C) 2014, Douglas W. Bell
#
# This is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License, either Version 2 or any later
# version. This program is distributed in the hope that it will be useful,
# but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
#*****************************************************************************
import sys
import os.path
from PyQt4 import QtCore, QtGui
import convertdlg
class FindDlg(QtGui.QWidget):
"""Dialog for filtering and searching for units.
"""
def __init__(self, mainDlg, parent=None):
QtGui.QWidget.__init__(self, parent)
self.setAttribute(QtCore.Qt.WA_QuitOnClose, False)
self.mainDlg = mainDlg
self.setWindowTitle(_('Unit Finder'))
self.currentType = ''
self.currentSearch = ''
mainLayout = QtGui.QVBoxLayout(self)
upperLayout = QtGui.QHBoxLayout()
mainLayout.addLayout(upperLayout)
filterBox = QtGui.QGroupBox(_('&Filter Unit Types'))
upperLayout.addWidget(filterBox)
filterLayout = QtGui.QHBoxLayout(filterBox)
self.filterCombo = QtGui.QComboBox()
filterLayout.addWidget(self.filterCombo)
searchBox = QtGui.QGroupBox(_('&Search String'))
mainLayout.addWidget(searchBox)
searchLayout = QtGui.QHBoxLayout(searchBox)
self.searchEdit = QtGui.QLineEdit()
searchLayout.addWidget(self.searchEdit)
clearButton = QtGui.QPushButton(_('C&lear'))
searchLayout.addWidget(clearButton)
clearButton.setFocusPolicy(QtCore.Qt.NoFocus)
self.unitListView = FindUnitListView()
mainLayout.addWidget(self.unitListView)
lowerLayout = QtGui.QHBoxLayout()
mainLayout.addLayout(lowerLayout)
fromBox = QtGui.QGroupBox(_('From Unit'))
lowerLayout.addWidget(fromBox)
fromLayout = QtGui.QVBoxLayout(fromBox)
fromReplaceButton = QtGui.QPushButton(_('&Replace'))
fromLayout.addWidget(fromReplaceButton)
fromReplaceButton.clicked.connect(self.fromRepl)
fromInsertButton = QtGui.QPushButton(_('&Insert'))
fromLayout.addWidget(fromInsertButton)
fromInsertButton.clicked.connect(self.fromIns)
toBox = QtGui.QGroupBox(_('To Unit'))
lowerLayout.addWidget(toBox)
toLayout = QtGui.QVBoxLayout(toBox)
toReplaceButton = QtGui.QPushButton(_('Replac&e'))
toLayout.addWidget(toReplaceButton)
toReplaceButton.clicked.connect(self.toRepl)
toInsertButton = QtGui.QPushButton(_('Inser&t'))
toLayout.addWidget(toInsertButton)
toInsertButton.clicked.connect(self.toIns)
self.buttonList = [fromReplaceButton, fromInsertButton,
toReplaceButton, toInsertButton]
closeButton = QtGui.QPushButton(_('&Close'))
upperLayout.addWidget(closeButton)
closeButton.clicked.connect(self.close)
option = self.mainDlg.option
xSize = option.intData('FinderXSize', 0, 10000)
ySize = option.intData('FinderYSize', 0, 10000)
if xSize and ySize:
self.resize(xSize, ySize)
self.move(option.intData('FinderXPos', 0, 10000),
option.intData('FinderYPos', 0, 10000))
self.loadUnits()
for col in range(3):
self.unitListView.resizeColumnToContents(col)
self.loadTypes()
self.filterCombo.activated[str].connect(self.changeType)
self.searchEdit.textChanged.connect(self.changeSearch)
clearButton.clicked.connect(self.searchEdit.clear)
self.unitListView.itemSelectionChanged.connect(self.updateCtrls)
def loadUnits(self):
"""Load unit items.
"""
self.unitListView.clear()
for unit in convertdlg.ConvertDlg.unitData.\
filteredList(self.currentType,
self.currentSearch):
FindUnitListItem(unit, self.unitListView)
self.unitListView.sortItems(0, QtCore.Qt.AscendingOrder)
if self.unitListView.topLevelItemCount() == 1:
self.unitListView.setItemSelected(self.unitListView.
topLevelItem(0), True)
self.updateCtrls()
def loadTypes(self):
"""Load combobox with type names.
"""
types = convertdlg.ConvertDlg.unitData.typeList[:]
types.sort()
self.filterCombo.clear()
self.filterCombo.addItem(_('[All]'))
prevName = ''
for name in types:
if name != prevName:
self.filterCombo.addItem(name)
prevName = name
def updateCtrls(self):
"""Change active status of unit set buttons.
"""
item = self.unitListView.selectedItems()
for button in self.buttonList:
button.setEnabled(item != [])
def changeType(self, newType):
"""Change current unit type setting.
"""
self.currentType = newType
if self.currentType == _('[All]'):
self.currentType = ''
self.loadUnits()
def changeSearch(self, newStr):
"""Update the search results based on a change to the text string.
"""
self.currentSearch = newStr
self.loadUnits()
def fromRepl(self):
"""Replace from unit with selected unit.
"""
item = self.unitListView.currentItem()
if item:
unit = item.unit
self.mainDlg.fromGroup.clearUnit()
self.mainDlg.fromGroup.replaceCurrent(unit)
self.mainDlg.fromUnitEdit.unitUpdate()
self.mainDlg.fromUnitListView.updateSelection()
def fromIns(self):
"""Insert selected unit into from unit.
"""
item = self.unitListView.currentItem()
if item:
unit = item.unit
self.mainDlg.fromGroup.replaceCurrent(unit)
self.mainDlg.fromUnitEdit.unitUpdate()
self.mainDlg.fromUnitListView.updateSelection()
def toRepl(self):
"""Replace to unit with selected unit.
"""
item = self.unitListView.currentItem()
if item:
unit = item.unit
self.mainDlg.toGroup.clearUnit()
self.mainDlg.toGroup.replaceCurrent(unit)
self.mainDlg.toUnitEdit.unitUpdate()
self.mainDlg.toUnitListView.updateSelection()
def toIns(self):
"""Insert selected unit into to unit.
"""
item = self.unitListView.currentItem()
if item:
unit = item.unit
self.mainDlg.toGroup.replaceCurrent(unit)
self.mainDlg.toUnitEdit.unitUpdate()
self.mainDlg.toUnitListView.updateSelection()
class FindUnitListView(QtGui.QTreeWidget):
"""ListView of units available.
"""
def __init__(self, parent=None):
QtGui.QTreeWidget.__init__(self, parent)
self.setRootIsDecorated(False)
self.setColumnCount(3)
self.setHeaderLabels([_('Unit Name'), _('Unit Type'), _('Comments')])
self.header().setStretchLastSection(False)
self.setSortingEnabled(True)
def sizeHint(self):
"""Adjust width smaller.
"""
size = QtGui.QTreeWidget.sizeHint(self)
size.setWidth(self.columnWidth(0) + self.columnWidth(1) +
self.columnWidth(2) + 10 + # fudge factor
self.verticalScrollBar().sizeHint().width())
return size
class FindUnitListItem(QtGui.QTreeWidgetItem):
"""Item in the find unit list view.
"""
def __init__(self, unit, parent=None):
QtGui.QTreeWidgetItem.__init__(self, parent)
self.unit = unit
self.setText(0, unit.description())
self.setText(1, unit.typeName)
self.setText(2, unit.comments[1])
ConvertAll/install.py 0000755 0001750 0001750 00000025770 12273255154 013651 0 ustar doug doug #!/usr/bin/env python3
"""
****************************************************************************
install.py, Linux install script for ConvertAll
Copyright (C) 2014, Douglas W. Bell
This is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License, either Version 2 or any later
version. This program is distributed in the hope that it will be useful,
but WITTHOUT ANY WARRANTY. See the included LICENSE file for details.
*****************************************************************************
"""
import sys
import os.path
import getopt
import shutil
import compileall
import py_compile
import glob
import re
import subprocess
prefixDir = '/usr/local'
buildRoot = '/'
progName = 'convertall'
docDir = 'share/doc/{0}'.format(progName)
iconDir = 'share/icons/{0}'.format(progName)
def usage(exitCode=2):
"""Display usage info and exit.
Arguments:
exitCode -- the code to retuen when exiting.
"""
global prefixDir
global buildRoot
print('Usage:')
print(' python install.py [-h] [-p dir] [-d dir] [-i dir] '
'[-b dir] [-s] [-x]')
print('where:')
print(' -h display this help message')
print(' -p dir install prefix [default: {0}]'.format(prefixDir))
print(' -d dir documentaion dir [default: /{0}]'
.format(docDir))
print(' -i dir icon dir [default: /{0}]'.format(iconDir))
print(' -b dir temporary build root for packagers [default: {0}]'
.format(buildRoot))
print(' -s skip language translation files')
print(' -x skip all dependency checks (risky)')
sys.exit(exitCode)
def cmpVersions(versionStr, reqdTuple):
"""Return True if point-sep values in versionStr are >= reqdTuple.
Arguments:
versionStr -- a string with point-separated version numbers
reqdTuple -- a tuple of version integers for the minimum acceptable
"""
match = re.search(r'[0-9\.]+', versionStr)
if not match:
return False
versionStr = match.group()
versionList = [int(val) for val in versionStr.split('.') if val]
reqdList = list(reqdTuple)
while len(versionList) < len(reqdList):
versionList.append(0)
while len(reqdList) < len(versionList):
reqdList.append(0)
if versionList >= reqdList:
return True
return False
def copyDir(srcDir, dstDir):
"""Copy all regular files from srcDir to dstDir.
dstDir is created if necessary.
Arguments:
srcDir -- the source dir path
dstDir -- the destination dir path
"""
try:
if not os.path.isdir(dstDir):
os.makedirs(dstDir)
names = os.listdir(srcDir)
for name in names:
srcPath = os.path.join(srcDir, name)
if os.path.isfile(srcPath):
shutil.copy2(srcPath, os.path.join(dstDir, name))
except (IOError, OSError) as e:
if str(e).find('Permission denied') >= 0:
print('Error - must be root to install files')
cleanSource()
sys.exit(4)
raise
def createWrapper(execDir, execName):
"""Create a wrapper executable file for a python script in execDir.
Arguments:
execDir -- the path where the executable is placed
execName -- the name for the executable file
"""
text = '#!/bin/sh\n\nexec {0} {1}/{2}.py "$@"'.format(sys.executable,
execDir,
execName)
with open(execName, 'w') as f:
f.write(text)
os.chmod(execName, 0o755)
def replaceLine(path, origLineStart, newLine):
"""Replaces lines with origLineStart with newLine and rewrites the file.
Arguments:
path -- the file to modify
origLineStart -- the beginning of the line to be replaced
newLine -- the replacement line
"""
with open(path, 'r') as f:
lines = f.readlines()
with open(path, 'w') as f:
for line in lines:
if line.startswith(origLineStart):
f.write(newLine)
else:
f.write(line)
def cleanSource():
"""Remove any temporary files added to untarred dirs.
"""
for name in glob.glob(os.path.join('source', '*.py[co]')):
os.remove(name)
removeDir(os.path.join('source', '__pycache__'))
global progName
if os.path.isfile(progName):
os.remove(progName)
def removeDir(dir):
"""Remove dir and all files under it, ignore errors.
Arguments:
dir -- the directory to remove
"""
try:
shutil.rmtree(dir, 1)
except: # shouldn't be needed with ignore error param, but
pass # some python versions have a bug
def main():
"""Main installer function.
"""
optLetters = 'hp:d:i:b:sx'
try:
opts, args = getopt.getopt(sys.argv[1:], optLetters)
except getopt.GetoptError:
usage(2)
global prefixDir
global docDir
global iconDir
global buildRoot
global progName
depCheck = True
translated = True
for opt, val in opts:
if opt == '-h':
usage(0)
elif opt == '-p':
prefixDir = os.path.abspath(val)
elif opt == '-d':
docDir = val
elif opt == '-i':
iconDir = val
elif opt == '-b':
buildRoot = val
elif opt == '-s':
translated = False
elif opt == '-x':
depCheck = False
if not os.path.isfile('install.py'):
print('Error - {0} files not found'.format(progName))
print('The directory containing "install.py" must be current')
sys.exit(4)
if (os.path.isdir('source') and
not os.path.isfile('source/{0}.py'.format(progName))):
print('Error - source files not found')
print('Retry the extraction from the tar archive')
sys.exit(4)
if depCheck:
print('Checking dependencies...')
pyVersion = sys.version_info[:3]
pyVersion = '.'.join([str(num) for num in pyVersion])
if cmpVersions(pyVersion, (3, 2)):
print(' Python Version {0} -> OK'.format(pyVersion))
else:
print(' Python Version {0} -> Sorry, 3.2 or higher is required'
.format(pyVersion))
sys.exit(3)
try:
from PyQt4 import QtCore, QtGui
except:
print(' Sorry, Qt Version 4.6, 4.7 or 4.8 and '
'PyQt Version 4.8, 4.9 or 4.10 are required')
sys.exit(3)
qtVersion = QtCore.qVersion()
if cmpVersions(qtVersion, (4, 6)) and not qtVersion.startswith('5'):
print(' Qt Version {0} -> OK'.format(qtVersion))
else:
print(' Qt Version {0} -> Sorry, 4.6, 4.7 or 4.8 is required'
.format(qtVersion))
sys.exit(3)
pyqtVersion = QtCore.PYQT_VERSION_STR
if (cmpVersions(pyqtVersion, (4, 8)) and
not pyqtVersion.startswith('5')):
print(' PyQt Version {0} -> OK'.format(pyqtVersion))
else:
print(' PyQt Version {0} -> Sorry, 4.8, 4.9 or 4.10 is required'
.format(pyqtVersion))
sys.exit(3)
pythonPrefixDir = os.path.join(prefixDir, 'share', progName)
pythonBuildDir = os.path.join(buildRoot, pythonPrefixDir[1:])
if os.path.isdir('source'):
compileall.compile_dir('source',
ddir=os.path.join(prefixDir, 'source'))
print('Installing files...')
print(' Copying python files to {0}'.format(pythonBuildDir))
removeDir(pythonBuildDir) # remove old?
copyDir('source', pythonBuildDir)
if os.path.isdir('source/__pycache__'):
copyDir('source/__pycache__',
os.path.join(pythonBuildDir, '__pycache__'))
if os.path.isdir('source/plugins'):
pluginBuildDir = os.path.join(pythonBuildDir, 'plugins')
print(' Creating plugins directory if necessary')
copyDir('source/plugins', pluginBuildDir)
if os.path.isdir('translations') and translated:
translationDir = os.path.join(pythonBuildDir, 'translations')
print(' Copying translation files to {0}'.format(translationDir))
copyDir('translations', translationDir)
if os.path.isdir('doc'):
docPrefixDir = docDir.replace('/', '')
if not os.path.isabs(docPrefixDir):
docPrefixDir = os.path.join(prefixDir, docPrefixDir)
docBuildDir = os.path.join(buildRoot, docPrefixDir[1:])
print(' Copying documentation files to {0}'.format(docBuildDir))
copyDir('doc', docBuildDir)
if not translated:
for name in glob.glob(os.path.join(docBuildDir,
'*_[a-z][a-z].html')):
os.remove(name)
# update help file location in main python script
replaceLine(os.path.join(pythonBuildDir, '{0}.py'.format(progName)),
'helpFilePath = None',
'helpFilePath = \'{0}\' # modified by install script\n'
.format(docPrefixDir))
if os.path.isdir('data'):
dataPrefixDir = os.path.join(prefixDir, 'share', progName, 'data')
dataBuildDir = os.path.join(buildRoot, dataPrefixDir[1:])
print(' Copying data files to {0}'.format(dataBuildDir))
removeDir(dataBuildDir) # remove old?
copyDir('data', dataBuildDir)
if not translated:
for name in glob.glob(os.path.join(dataBuildDir,
'*_[a-z][a-z].dat')):
os.remove(name)
# update data file location in main python script
replaceLine(os.path.join(pythonBuildDir, '{0}.py'.format(progName)),
'dataFilePath = None',
'dataFilePath = \'{0}\' # modified by install script\n'
.format(dataPrefixDir))
if os.path.isdir('icons'):
iconPrefixDir = iconDir.replace('/', '')
if not os.path.isabs(iconPrefixDir):
iconPrefixDir = os.path.join(prefixDir, iconPrefixDir)
iconBuildDir = os.path.join(buildRoot, iconPrefixDir[1:])
print(' Copying icon files to {0}'.format(iconBuildDir))
copyDir('icons', iconBuildDir)
# update icon location in main python script
replaceLine(os.path.join(pythonBuildDir, '{0}.py'.format(progName)),
'iconPath = None',
'iconPath = \'{0}\' # modified by install script\n'
.format(iconPrefixDir))
if os.path.isdir('source'):
createWrapper(pythonPrefixDir, progName)
binBuildDir = os.path.join(buildRoot, prefixDir[1:], 'bin')
print(' Copying executable file "{0}" to {1}'
.format(progName, binBuildDir))
if not os.path.isdir(binBuildDir):
os.makedirs(binBuildDir)
shutil.copy2(progName, binBuildDir)
cleanSource()
print('Install complete.')
if __name__ == '__main__':
main()
ConvertAll/translations/ 0000755 0001750 0001750 00000000000 12273255316 014334 5 ustar doug doug ConvertAll/translations/qt_es.ts 0000644 0001750 0001750 00000516255 12271615643 016036 0 ustar doug doug
PPDOptionsModelNameNombreValueQ3Accel%1, %2 not definedLa secuencia %1, %2 no está definidaAmbiguous %1 not handledSecuencia ambigua %1 no tratadaQ3DataTableTrueVerdaderoFalseFalsoInsertInsertarUpdateActualizarDeleteBorrarQ3FileDialogCopy or Move a FileCopiar o mover un ficheroRead: %1Lectura: %1Write: %1Escritura: %1CancelCancelarAll Files (*)Todos los ficheros (*)NameNombreSizeTamañoTypeTipoDateFechaAttributesAtributos&OK&AceptarLook &in:Buscar &en:File &name:&Nombre de fichero:File &type:&Tipo de fichero:BackPrecedente (histórico)One directory upIr al directorio superiorCreate New FolderCrear una nueva carpetaList ViewVista de listaDetail ViewVista detalladaPreview File InfoInformación del fichero previsualizadoPreview File ContentsContenido del fichero previsualizadoRead-writeLectura-escrituraRead-onlySólo lecturaWrite-onlySólo escrituraInaccessibleInaccesibleSymlink to FileEnlace simbólico a un ficheroSymlink to DirectoryEnlace simbólico a un directorioSymlink to SpecialEnlace simbólico a un fichero especialFileFicheroDirDirSpecialFichero especialOpenAbrirSave AsGuardar como&Open&Abrir&Save&Guardar&Rename&Renombrar&Delete&BorrarR&eloadR&ecargarSort by &NameOrdenar por &nombreSort by &SizeOrdenar por &tamañoSort by &DateOrdenar por &fecha&Unsorted&Sin ordenarSortOrdenarShow &hidden filesMostrar los ficheros &ocultosthe fileel ficherothe directoryel directoriothe symlinkel enlace simbólicoDelete %1Borrar %1<qt>Are you sure you wish to delete %1 "%2"?</qt><qt>¿Seguro que desea borrar %1 «%2»?</qt>&Yes&Sí&No&NoNew Folder 1Nueva carpeta 1New FolderNueva carpetaNew Folder %1Nueva carpeta %1Find DirectoryBuscar en el directorioDirectoriesDirectoriosDirectory:Directorio:ErrorError%1
File not found.
Check path and filename.%1
Fichero no encontrado.
Compruebe la ruta y el nombre del fichero.All Files (*.*)Todos los ficheros (*.*)Open Abrir Select a DirectorySeleccionar un directorioQ3LocalFsCould not read directory
%1No se ha podido leer el directorio
%1Could not create directory
%1No se ha podido crear el directorio
%1Could not remove file or directory
%1No se ha podido borrar el fichero o directorio
%1Could not rename
%1
to
%2No se ha podido renombrar
%1
a
%2Could not open
%1No se ha podido abrir
%1Could not write
%1No se ha podido escribir
%1Q3MainWindowLine upAlinearCustomize...Personalizar...Q3NetworkProtocolOperation stopped by the userOperación detenida por el usuarioQ3ProgressDialogCancelCancelarQ3TabDialogOKAceptarApplyAplicarHelpAyudaDefaultsValores por omisiónCancelCancelarQ3TextEdit&Undo&Deshacer&Redo&RehacerCu&tCor&tar&Copy&Copiar&Paste&PegarClearLimpiarSelect AllSeleccionar todoQ3TitleBarSystemRestore upMinimizeMinimizarRestore downMaximizeCloseCerrarContains commands to manipulate the windowPuts a minimized back to normalMoves the window out of the wayPuts a maximized window back to normalMakes the window full screenCloses the windowDisplays the name of the window and contains controls to manipulate itQ3ToolBarMore...Más...Q3UrlOperatorThe protocol `%1' is not supportedEl protocolo «%1» no está contempladoThe protocol `%1' does not support listing directoriesEl protocolo «%1» no permite listar los ficheros de un directorioThe protocol `%1' does not support creating new directoriesEl protocolo «%1» no permite crear nuevos directoriosThe protocol `%1' does not support removing files or directoriesEl protocolo «%1» no permite borrar ficheros o directoriosThe protocol `%1' does not support renaming files or directoriesEl protocolo «%1» no permite renombrar ficheros o directoriosThe protocol `%1' does not support getting filesEl protocolo «%1» no permite recibir ficherosThe protocol `%1' does not support putting filesEl protocolo «%1» no permite enviar ficherosThe protocol `%1' does not support copying or moving files or directoriesEl protocolo «%1» no permite copiar o mover ficheros o directorios(unknown)(desconocido)Q3Wizard&Cancel&Cancelar< &Back< &Anterior&Next >Siguie&nte >&Finish&Terminar&Help&AyudaQAbstractSocketHost not foundEquipo no encontradoConnection refusedConexión rechazadaSocket operation timed outOperación socket expiradaSocket is not connectedQAbstractSpinBox&Step up&AumentarStep &downRe&ducirQApplicationActivateActivarExecutable '%1' requires Qt %2, found Qt %3.El ejecutable «%1» requiere Qt %2 (se encontró Qt %3).Incompatible Qt Library ErrorError: biblioteca Qt incompatibleQT_LAYOUT_DIRECTIONTranslate this string to the string 'LTR' in left-to-right languages or to 'RTL' in right-to-left languages (such as Hebrew and Arabic) to get proper widget layout.LTRActivates the program's main windowActiva la ventana principal del programaQAxSelectSelect ActiveX ControlOKAceptar&Cancel&CancelarCOM &Object:QCheckBoxUncheckCheckToggleQColorDialogHu&e:&Tono:&Sat:&Saturación:&Val:&Brillo:&Red:&Rojo:&Green:&Verde:Bl&ue:Az&ul:A&lpha channel:Canal a&lfa:&Basic colorsColores &básicos&Custom colorsColores &personalizados&Define Custom Colors >>&Definir colores personalizados >>OKAceptarCancelCancelar&Add to Custom Colors&Añadir a los colores personalizadosSelect colorSelección de un colorQComboBoxOpenAbrirQDB2DriverUnable to connectUnable to commit transactionUnable to rollback transactionUnable to set autocommitQDB2ResultUnable to execute statementUnable to prepare statementUnable to bind variableUnable to fetch record %1Unable to fetch nextUnable to fetch firstQDateTimeEditAMAMamamPMPMpmpmQDialogWhat's This?¿Qué es esto?QDialogButtonBoxOKAceptarSaveGuardarOpenAbrirCancelCancelarCloseCerrarApplyAplicarResetHelpAyudaDon't SaveDiscard&Yes&SíYes to &AllSí a &todo&No&NoN&o to AllN&o a todoSave AllAbortInterrumpirRetryReintentarIgnoreIgnorarRestore DefaultsClose without SavingQDialogButtonsYes to AllSí a todoOK to AllAceptar a todoNo to AllNo a todoCancel AllCancelar todoYesSíOKAceptarNoNoCancelCancelarApplyAplicarIgnoreIgnorarRetryReintentarAbortInterrumpirHelpAyuda%1 to All%1 a todoQDirModelNameNombreSizeTamañoTypeTipoModifiedModificadoKindMatch OS X FinderTypeAll other platformsTipoDate ModifiedQErrorMessageDebug Message:Mensaje de depuración:Warning:Aviso:Fatal Error:Error fatal:&Show this message againMo&strar este mensaje de nuevo&OK&AceptarQFileDialogAll Files (*)Todos los ficheros (*)DirectoriesDirectorios&Open&Abrir&Save&GuardarOpenAbrirSaveGuardar%1 already exists.
Do you want to replace it?El fichero %1 ya existe.
¿Desea reemplazarlo?%1
File not found.
Please verify the correct file name was given.%1
Fichero no encontrado.
Verifique que el nombre del fichero es correcto.My ComputerMi computadoraSortOrdenar&Rename&Renombrar&Delete&Borrar&Reload&RecargarSort by &NameOrdenar por &nombreSort by &SizeOrdenar por &tamañoSort by &DateOrdenar por &fecha&Unsorted&Sin ordenarShow &hidden filesMostrar los ficheros &ocultosBackAnteriorParent DirectoryDirectorio superiorCreate New FolderCrear una nueva carpetaList ViewVista de listaDetail ViewVista detalladaLook in:Buscar en:File name:Nombre de fichero:Files of type:Ficheros de tipo:CancelCancelarDirectory:Directorio:
File not found.
Please verify the correct file name was given%1
Directory not found.
Please verify the correct directory name was given.%1
Directorio no encontrado.
Verique que el nombre del directorio es correcto.'%1' is write protected.
Do you want to delete it anyway?Are sure you want to delete '%1'?Could not delete directory.All Files (*.*)Todos los ficheros (*.*)Save AsGuardar comoOpen Abrir Select a DirectorySeleccionar un directorioDriveUnidadFileFicheroUnknownDesconocidoQFileDialogPrivate%1
Directory not found.
Please verify the correct directory name was given.%1
Directorio no encontrado.
Verique que el nombre del directorio es correcto.QFontDialog&Font&Tipo de letraFont st&yle&Estilo del tipo de letra&Size&TamañoEffectsEfectosStri&keout&Tachado&UnderlineS&ubrayadoSampleMuestraWr&iting SystemSistema de escr&ituraOKAceptarApplyAplicarCancelCancelarCloseCerrarSelect FontSeleccionar un tipo de letraQFtpNot connectedNo conectadoHost %1 not foundEquipo %1 no encontradoConnection refused to host %1Conexión rechazada al equipo %1Connected to host %1Conectado al equipo %1Connection refused for data connectionConexión para conexión de datos rechazadaUnknown errorError desconocidoConnecting to host failed:
%1La conexión con el equipo ha fallado:
%1Login failed:
%1Identificación fallida:
%1Listing directory failed:
%1El listado del directorio ha fallado:
%1Changing directory failed:
%1Fallo del cambio de directorio:
%1Downloading file failed:
%1Fallo de la descarga del fichero:
%1Uploading file failed:
%1El envío del fichero ha fallado:
%1Removing file failed:
%1Eliminación de fichero fallida:
%1Creating directory failed:
%1Fallo de la creación de un directorio:
%1Removing directory failed:
%1Eliminación de directorio fallida:
%1Connection closedConexión cerradaHost %1 foundEquipo %1 encontradoConnection to %1 closedConexión a %1 cerradaHost foundEquipo encontradoConnected to hostConectado al equipoQHostInfoUnknown errorError desconocidoQHostInfoAgentHost not foundEquipo no encontradoUnknown address typeDirección de tipo desconocidoUnknown errorError desconocidoQHttpUnknown errorError desconocidoRequest abortedSolicitud interrumpidaNo server set to connect toNo se ha indicado ningún servidor al que conectarseWrong content lengthLongitud del contenido erróneaServer closed connection unexpectedlyEl servidor cerró la conexión inesperadamenteConnection refusedConexión rechazadaHost %1 not foundEquipo %1 no encontradoHTTP request failedSolicitud HTTP fallidaInvalid HTTP response headerCabecera de respuesta HTTP no válidaInvalid HTTP chunked bodyFragmento HTTP no válidoHost %1 foundEquipo %1 encontradoConnected to host %1Conectado al equipo %1Connection to %1 closedConexión a %1 cerradaHost foundEquipo encontradoConnected to hostConectado al equipoConnection closedConexión cerradaQIBaseDriverError opening databaseCould not start transactionUnable to commit transactionUnable to rollback transactionQIBaseResultUnable to create BLOBUnable to write BLOBUnable to open BLOBUnable to read BLOBCould not find arrayCould not get array dataCould not get query infoCould not start transactionUnable to commit transactionCould not allocate statementCould not prepare statementCould not describe input statementCould not describe statementUnable to close statementUnable to execute queryCould not fetch next itemCould not get statement infoQIODevicePermission deniedPermiso denegadoToo many open filesDemasiados ficheros abiertos simultáneamenteNo such file or directoryNo hay ningún fichero o directorio con ese nombreNo space left on deviceNo queda espacio en el dispositivoUnknown errorError desconocidoQInputContextXIMXIMXIM input methodMétodo de entrada XIMWindows input methodMétodo de entrada WindowsMac OS X input methodMétodo de entrada Mac OS XQInputDialogOKAceptarCancelCancelarQLibraryQLibrary::load_sys: Cannot load %1 (%2)QLibrary::unload_sys: Cannot unload %1 (%2)QLibrary::resolve_sys: Symbol "%1" undefined in %2 (%3)Could not mmap '%1': %2Plugin verification data mismatch in '%1'Could not unmap '%1': %2The plugin '%1' uses incompatible Qt library. (%2.%3.%4) [%5]The plugin '%1' uses incompatible Qt library. Expected build key "%2", got "%3"Unknown errorError desconocidoQLineEdit&Undo&Deshacer&Redo&RehacerCu&tCor&tar&Copy&Copiar&Paste&PegarDeleteBorrarSelect AllSeleccionar todoQMYSQLDriverUnable to open database 'Unable to connectUnable to begin transactionUnable to commit transactionUnable to rollback transactionQMYSQLResultUnable to fetch dataUnable to execute queryUnable to store resultUnable to prepare statementUnable to reset statementUnable to bind valueUnable to execute statementUnable to bind outvaluesUnable to store statement resultsQMenuCloseCerrarOpenAbrirExecuteQMenuBarAboutConfigPreferenceOptionsOpcionesSettingSetupQuitExitAbout %1About QtAcerca de QtPreferencesQuit %1QMessageBoxHelpAyudaOKAceptarCancelCancelar&Yes&Sí&No&No&Abort&Interrumpir&Retry&Reintentar&Ignore&IgnorarYes to &AllSí a &todoN&o to AllN&o a todo<h3>About Qt</h3>%1<p>Qt is a C++ toolkit for cross-platform application development.</p><p>Qt provides single-source portability across MS Windows, Mac OS X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qtopia Core.</p><p>Qt is a Trolltech product. See <tt>http://www.trolltech.com/qt/</tt> for more information.</p><h3>Acerca de Qt</h3>%1
<p>Qt es una caja de herramientas en C++ para el desarrollo de aplicaciones multiplataforma.</p>
<p>Qt permite la portabilidad de un solo código fuente entre MS Windows, Mac OS X, GNU/Linux, y las principales versiones comerciales de Unix. Qt también está disponible para los sistemas embebidos bajo el nombre de Qtopia Core.</p>
<p>Qt es un producto de Trolltech. Consulte <tt>http://www.trolltech.com/qt/</tt> para más información.</p>About QtAcerca de Qt<p>This program uses Qt version %1.</p><p>Este programa utiliza la versión %1 de Qt.</p><p>This program uses Qt Open Source Edition version %1.</p><p>Qt Open Source Edition is intended for the development of Open Source applications. You need a commercial Qt license for development of proprietary (closed source) applications.</p><p>Please see <tt>http://www.trolltech.com/company/model.html</tt> for an overview of Qt licensing.</p><p>Este programa utiliza la edición Open Source de Qt versión %1.</p>
<p>La edición Open Source de Qt está destinada al desarrollo de aplicaciones libres. Necesita una licencia comercial de Qt para desarrollar aplicaciones privativas (de código cerrado).</p>
<p>Consulte en <tt>http://www.trolltech.com/company/model.html</tt> una explicación de las licencias de Qt.</p><h3>About Qt</h3>%1<p>Qt is a C++ toolkit for cross-platform application development.</p><p>Qt provides single-source portability across MS Windows, Mac OS X, Linux, and all major commercial Unix variants. Qt is also available for embedded devices as Qtopia Core.</p><p>Qt is a Trolltech product. See <a href="http://www.trolltech.com/qt/">www.trolltech.com/qt/</a> for more information.</p>Show Details...Hide Details...<p>This program uses Qt Open Source Edition version %1.</p><p>Qt Open Source Edition is intended for the development of Open Source applications. You need a commercial Qt license for development of proprietary (closed source) applications.</p><p>Please see <a href="http://www.trolltech.com/company/model/">www.trolltech.com/company/model/</a> for an overview of Qt licensing.</p>QMultiInputContextSelect IMQMultiInputContextPluginMultiple input method switcherMultiple input method switcher that uses the context menu of the text widgetsQNativeSocketEngineThe remote host closed the connectionEl equpo remoto ha cerrado la conexiónNetwork operation timed outLa operación de red ha expiradoOut of resourcesInsuficientes recursosUnsupported socket operationOperación socker no admitidaProtocol type not supportedTipo de protocolo no admitidoInvalid socket descriptorDescriptor de socket no válidoNetwork unreachableRed inalcanzablePermission deniedPermiso denegadoConnection timed outConexión expiradaConnection refusedConexión rechazadaThe bound address is already in useLa dirección enlazada ya está en usoThe address is not availableLa dirección no está disponibleThe address is protectedLa dirección está protegidaDatagram was to large to sendEl datagrama es demasiado grande para poder ser enviadoUnable to send a messageImposible enviar un mensajeUnable to receive a messageImposible recibir un mensajeUnable to writeImposible escribirNetwork errorError de redAnother socket is already listening on the same portYa hay otro socket escuchando por el mismo puertoUnable to initialize non-blocking socketImposible inicializar el socket no bloqueanteUnable to initialize broadcast socketImposible inicializar el socket de difusiónAttempt to use IPv6 socket on a platform with no IPv6 supportIntento de usar un socket IPv6 sobre una plataforma que no contempla IPv6Host unreachableDatagram was too large to sendOperation on non-socketUnknown errorError desconocidoQOCIDriverUnable to logonUnable to initializeQOCIDriverQOCIResultUnable to bind column for batch executeUnable to execute batch statementUnable to goto nextUnable to alloc statementUnable to prepare statementUnable to bind valueUnable to execute select statementUnable to execute statementQODBCDriverUnable to connectUnable to connect - Driver doesn't support all needed functionalityUnable to disable autocommitUnable to commit transactionUnable to rollback transactionUnable to enable autocommitQODBCResultQODBCResult::reset: Unable to set 'SQL_CURSOR_STATIC' as statement attribute. Please check your ODBC driver configurationUnable to execute statementUnable to fetch nextUnable to prepare statementUnable to bind variableQObjectAll Files (*)Todos los ficheros (*)All Files (*.*)Todos los ficheros (*.*)OpenAbrirSave AsGuardar comoOpen Abrir Select a DirectorySeleccionar un directorioDriveUnidadFileFicheroDirectoryDirectorioSymbolic LinkEnlace simbólicoUnknownDesconocidoFalseFalsoTrueVerdaderoHomeInicioQPSQLDriverUnable to connectCould not begin transactionCould not commit transactionCould not rollback transactionQPSQLResultUnable to create queryQPluginLoaderUnknown errorError desconocidoQPrintDialoglocally connectedconectado localmenteAliases: %1Alias: %1unknowndesconocidoUnknown LocationUbicación desconocidaPrinter settingsConfiguración de la impresiónPrint in color if availableImprimir en color si es posiblePrint in grayscaleImprimir en tonos de grisPrint destinationDestino de la impresiónPrint to printer:Imprimir por la impresora:Print to file:Imprimir en un fichero:Browse...Examinar...OptionsOpcionesPrint allImprimir todoPrint selectionImprimir la selecciónPrint rangeImprimir intervaloFrom page:Desde la página:To page:Hasta la página:Print first page firstImprimir primero la primera páginaPrint last page firstImprimir primero la última páginaNumber of copies:Número de copias:Paper formatFormato del papelPortraitVerticalLandscapeApaisadoA0 (841 x 1189 mm)A0 (841 x 1189 mm)A1 (594 x 841 mm)A1 (594 x 841 mm)A2 (420 x 594 mm)A2 (420 x 594 mm)A3 (297 x 420 mm)A3 (297 x 420 mm)A4 (210 x 297 mm, 8.26 x 11.7 inches)A4 (210 x 297 mm, 8,26 x 11,7 pulgadas)A5 (148 x 210 mm)A5 (148 x 210 mm)A6 (105 x 148 mm)A6 (105 x 148 mm)A7 (74 x 105 mm)A7 (74 x 105 mm)A8 (52 x 74 mm)A8 (52 x 74 mm)A9 (37 x 52 mm)A9 (37 x 52 mm)B0 (1000 x 1414 mm)B0 (1000 x 1414 mm)B1 (707 x 1000 mm)B1 (707 x 1000 mm)B2 (500 x 707 mm)B2 (500 x 707 mm)B3 (353 x 500 mm)B3 (353 x 500 mm)B4 (250 x 353 mm)B4 (250 x 353 mm)B5 (176 x 250 mm, 6.93 x 9.84 inches)B5 (176 x 250 mm, 6,93 x 9,84 pulgadas)B6 (125 x 176 mm)B6 (125 x 176 mm)B7 (88 x 125 mm)B7 (88 x 125 mm)B8 (62 x 88 mm)B8 (62 x 88 mm)B9 (44 x 62 mm)B9 (44 x 62 mm)B10 (31 x 44 mm)B10 (31 x 44 mm)C5E (163 x 229 mm)C5E (163 x 229 mm)DLE (110 x 220 mm)DLE (110 x 220 mm)Executive (7.5 x 10 inches, 191 x 254 mm)Ejecutivo (7,5 x 10 pulgadas, 191 x 254 mm)Folio (210 x 330 mm)Folio (210 x 330 mm)Ledger (432 x 279 mm)Ledger (432 x 279 mm)Legal (8.5 x 14 inches, 216 x 356 mm)Legal (8,5 x 14 pulgadas, 216 x 356 mm)Letter (8.5 x 11 inches, 216 x 279 mm)Carta (8,5 x 11 pulgadas, 216 x 279 mm)Tabloid (279 x 432 mm)Tabloide (279 x 432 mm)US Common #10 Envelope (105 x 241 mm)Sobre US Common #10 (105 x 241 mm)PostScript Files (*.ps);;All Files (*)Ficheros PostScript (*.ps);;Todos los ficheros (*)OKAceptarCancelCancelarPage size:Tamaño de página:Orientation:Orientación:Paper source:Fuente del papel:PrintImpr PantFileFicheroPrinterPrint To File ...Print dialogSize:PropertiesPrinter info:BrowsePrint to filePages fromtoSelectionCopiesCollateOtherDouble side printingFile %1 is not writable.
Please choose a different file name.%1 already exists.
Do you want to overwrite it?File exists<qt>Do you want to overwrite it?</qt>QPrintPropertiesDialogPPD PropertiesSaveGuardarOKAceptarQProcessUnknown errorError desconocidoQProgressBar%1%%1%QProgressDialogCancelCancelarQPushButtonOpenAbrirQRadioButtonCheckQRegExpno error occurredno se ha producido ningún errordisabled feature usedse ha usado una característica no habilitadabad char class syntaxsintaxis no válida para clase de caracteresbad lookahead syntaxsintaxis no válida para lookaheadbad repetition syntaxsintaxis no válida para repeticióninvalid octal valuevalor octal no válidomissing left delimfalta el delimitador izquierdounexpected endfin inesperadomet internal limitse alcanzó el límite internoQSQLite2DriverError to open databaseUnable to begin transactionUnable to commit transactionUnable to rollback TransactionQSQLite2ResultUnable to fetch resultsUnable to execute statementQSQLiteDriverError opening databaseError closing databaseUnable to begin transactionUnable to commit transactionUnable to roll back transactionQSQLiteResultUnable to fetch rowUnable to execute statementUnable to reset statementUnable to bind parametersParameter count mismatchQScrollBarScroll hereDesplazar hasta aquíLeft edgeBorde izquierdoTopPrincipioRight edgeBorde derechoBottomFinalPage leftUna página a la izquierdaPage upUna página hacia arribaPage rightUna página a la derechaPage downUna página hacia abajoScroll leftDesplazar hacia la izquierdaScroll upDesplazar hacia arribaScroll rightDesplazar hacia la derechaScroll downDesplazar hacia abajoLine upAlinearPositionLine downQShortcutSpaceEspacioEscEscTabTabBacktabTabulador hacia atrásBackspaceBorrarReturnRetornoEnterIntroInsInsDelSuprPausePausaPrintImpr PantSysReqPetSisHomeInicioEndFinLeftIzquierdaUpArribaRightDerechaDownAbajoPgUpRe PágPgDownAv PágCapsLockBloq MayúsNumLockBloq NumScrollLockBloq DesplMenuMenúHelpAyudaBackAnteriorForwardSiguienteStopDetenerRefreshActualizarVolume DownBajar el volumenVolume MuteSilenciarVolume UpSubir el volumenBass BoostPotenciar los gravesBass UpSubir los gravesBass DownBajar los gravesTreble UpSubir los agudosTreble DownBajar los agudosMedia PlayReproducir el medioMedia StopDetener el medioMedia PreviousMedio anteriorMedia NextSiguiente medioMedia RecordGrabar medioFavoritesFavoritosSearchBúsquedaStandbyReposoOpen URLAbrir URLLaunch MailLanzar correoLaunch MediaLanzar medioLaunch (0)Lanzar (0)Launch (1)Lanzar (1)Launch (2)Lanzar (2)Launch (3)Lanzar (3)Launch (4)Lanzar (4)Launch (5)Lanzar (5)Launch (6)Lanzar (6)Launch (7)Lanzar (7)Launch (8)Lanzar (8)Launch (9)Lanzar (9)Launch (A)Lanzar (A)Launch (B)Lanzar (B)Launch (C)Lanzar (C)Launch (D)Lanzar (D)Launch (E)Lanzar (E)Launch (F)Lanzar (F)Print ScreenImprimir pantallaPage UpRetroceder páginaPage DownAvanzar páginaCaps LockBloqueo de mayúsculasNum LockBloq numNumber LockBloqueo numéricoScroll LockBloqueo del desplazamientoInsertInsertarDeleteBorrarEscapeEscapeSystem RequestPetición del sistemaSelectSeleccionarYesSíNoNoContext1Contexto1Context2Contexto2Context3Contexto3Context4Contexto4CallLlamarHangupDescolgarFlipVoltearCtrlCtrlShiftMayAltAltMetaMeta++F%1F%1Home PageQSliderPage leftUna página a la izquierdaPage upUna página hacia arribaPositionPage rightUna página a la derechaPage downUna página hacia abajoQSocks5SocketEngineSocks5 timeout error connecting to socks serverError de expiracioń socks5 mientras se establecía una conexión al servidor socksQSpinBoxMoreLessQSqlDeleteBorrarDelete this record?¿Borrar este registro?YesSíNoNoInsertInsertarUpdateActualizarSave edits?¿Guardar las modificaciones?CancelCancelarConfirmConfirmarCancel your edits?¿Cancelar sus modificaciones?QTDSDriverUnable to open connectionUnable to use databaseQTabBarScroll LeftScroll RightQTcpServerSocket operation unsupportedOperación socket no admitidaQTextControl&Undo&Deshacer&Redo&RehacerCu&tCor&tar&Copy&CopiarCopy &Link Location&Paste&PegarDeleteBorrarSelect AllSeleccionar todoQTextEdit&Undo&Deshacer&Redo&RehacerCu&tCor&tar&Copy&Copiar&Paste&PegarDeleteBorrarSelect AllSeleccionar todoQToolButtonPressOpenAbrirQUdpSocketThis platform does not support IPv6La plataforma no contempla IPv6QUndoGroupUndoRedoQUndoModel<empty>QUndoStackUndoRedoQUnicodeControlCharacterMenuLRM Left-to-right markLRM Left-to-right markRLM Right-to-left markRLM Right-to-left markZWJ Zero width joinerZWJ Zero width joinerZWNJ Zero width non-joinerZWNJ Zero width non-joinerZWSP Zero width spaceZWSP Zero width spaceLRE Start of left-to-right embeddingLRE Start of left-to-right embeddingRLE Start of right-to-left embeddingRLE Start of right-to-left embeddingLRO Start of left-to-right overrideLRO Start of left-to-right overrideRLO Start of right-to-left overrideRLO Start of right-to-left overridePDF Pop directional formattingPDF Pop directional formattingInsert Unicode control characterInsertar carácter de control UnicodeQWhatsThisActionWhat's This?¿Qué es esto?QWidget**QWorkspace&Restore&Restaurar&Move&Mover&Size&TamañoMi&nimizeMi&nimizarMa&ximizeMa&ximizar&Close&CerrarStay on &TopPermanecer en &primer planoSh&adeSombre&ar%1 - [%2]%1 - [%2]MinimizeMinimizarRestore DownRestaurar abajoCloseCerrar&UnshadeQ&uitar sombraQXmlno error occurredno se ha producido ningún errorerror triggered by consumererror debido al consumidorunexpected end of filefin de fichero inesperadomore than one document type definitionmás de una definición de tipo de documentoerror occurred while parsing elementse ha producido un error durante el análisis de un elementotag mismatchetiqueta desequilibradaerror occurred while parsing contentse ha producido un error durante el análisis del contenidounexpected charactercarácter inesperadoinvalid name for processing instructionnombre de instrucción de tratamiento no válidoversion expected while reading the XML declarationse esperaba la versión al leer la declaración XMLwrong value for standalone declarationvalor erróneo para la declaración independienteencoding declaration or standalone declaration expected while reading the XML declarationse esperaba una declaración de codificación o declaración autónoma al leer la declaración XMLstandalone declaration expected while reading the XML declarationse esperaba una declaración independiente al leer la declaración XMLerror occurred while parsing document type definitionse ha producido un error durante el análisis de la definición de tipo de documentoletter is expectedse esperaba una letraerror occurred while parsing commentse ha producido un error durante el análisis de un comentarioerror occurred while parsing referencese ha producido un error durante el análisis de una referenciainternal general entity reference not allowed in DTDno se permiten referencias a entidades internas generales en la DTDexternal parsed general entity reference not allowed in attribute valueno se permiten referencias a entidades externas generales ya analizadas en el valor de un atributoexternal parsed general entity reference not allowed in DTDno se permiten referencias a entidades externas generales ya analizadas en la DTDunparsed entity reference in wrong contextreferencia a entidad no analizada en un contexto no válidorecursive entitiesentidades recursivaserror in the text declaration of an external entityerror en la declaración de texto de una entidad externa
ConvertAll/translations/convertall_es.ts 0000644 0001750 0001750 00000053411 12272340725 017546 0 ustar doug doug
cmdlineUsage:Uso:qt-optionsopciones-qt-or- (non-GUI):-o- (sin interfaz gráfica):optionsopcionesnumbernúmerofrom_unitdesde_unidadto_unita_unidadUnits with spaces must be "quoted"Unidades con espacios deben encerrarse entre "comillas"Options:Opciones:numnúmset number of decimals to showseleccione el número de decimales a mostrarshow set number of decimals, even if zerosmostrar el número seleccionado de decimales, incluso si son cerosdisplay this message and exitmostrar este mensaje y salirinteractive command line mode (non-GUI)modo interactivo en línea de comandos (no interfaz)convert without further promptsconvertir sin más interacciónshow results in scientific notationmostrar resultados en notación científicaEnter from unit -> Ingresar unidad de origen ->Enter to unit -> Ingresar unidad de destino ->Enter number, [n]ew, [r]everse or [q]uit -> Ingresar número, [n]uevo, [i]nverso o [s]alirUnits {0} and {1} are not compatibleLas unidades no son compatibles ({0} vs. {1}){0} is not a valid unit{0} no es una unidad válidaconvertdlg%d units loaded%d unidades leídasError in unit data - %sError en los datos de las unidades - %sFrom UnitDesde unidadTo UnitHacia unidadSet unitsSeleccionar unidadesNo Unit SetNinguna unidad seleccionada&Close&Cerrar&Unit Finder...B&uscador de unidades...&Options...&Opciones...&Help...A&yuda...&About...&Acerca de...Clear UnitLimpiar unidadResult DisplayPantalla de resultadosDecimal placesLugares decimalesUse scientific notationUtilizar notación científicaUse fixed decimal placesUtilizar un número fijo de decimalesButtonsBotonesShow operator buttonsMostrar los botones con los operadoresColorsColoresUse default system colorsUsar colores definidos por el sistemaSet background colorSeleccionar el color de fondoSet text colorSeleccionar el color del textoRead Me file not foundArchivo "léame" no encontradoConvertAll README FileArchivo LÉAME de ConvertAllConvertAll Version %s
by %sVersión de ConvertAll %s
por %sRecent UnitUnidad recienteRecent UnitsUnidades recientesNumber savedNúmero salvadoError in unit data - {0}Error en los datos de las unidades - {0}{0} units loaded{0} unidades leídasLoad last units at startupCargue últimas unidades en el arranqueUser InterfaceInterfaz de usuarioShow tip at startupMostrar toque en el arranqueConvertAll Version {0}
by {1}Versión de ConvertAll {0}
por {1}Convertall - TipConvertAll&OK&AceptarCombining UnitsLa combinación de Unidades<p>ConvertAll's strength is the ability to combine units:</p><ul><li>Enter "m/s" to get meters per second</li><li>Enter "ft*lbf" to get foot-pounds (torque)</li><li>Enter "in^2" to get square inches</li><li>Enter "m^3" to get cubic meters</li><li>or any other combinations you can imagine</li><p>La fuerza de ConvertAll es la capacidad de combinar unidades:</p><ul><li>introduzca "m / s" para obtener metros por segundo</li<li>Enter "ft * lbf" para obtener libras-pie (par)</li><li>Enter "en ^ 2" para pulgadas cuadradas</li><li>Enter "m ^ 3 "para obtener metros cúbicos</li<li>o cualquier otra combinación que se pueda imaginar</li></ul>Show this tip at startupMostrar toque en el arranque<p>ConvertAll's strength is the ability to combine units:</p><ul><li>Enter "m/s" to get meters per second</li><li>Enter "ft*lbf" to get foot-pounds (torque)</li><li>Enter "in^2" to get square inches</li><li>Enter "m^3" to get cubic meters</li><li>or any other combinations you can imagine</li></ul><p>La fuerza de ConvertAll es la capacidad de combinar unidades:</p><ul><li>introduzca "m / s" para obtener metros por segundo</li<li>Enter "ft * lbf" para obtener libras-pie (par)</li><li>Enter "in ^ 2" para pulgadas cuadradas</li><li>Enter "m ^ 3 "para obtener metros cúbicos</li<li>o cualquier otra combinación que se pueda imaginar</li></ul>finddlgUnit FinderBuscador de unidades&Filter Unit Types&Filtro de tipos de unidades&Search StringBu&scar cadenaC&lear&LimpiarFrom UnitDesde unidad&Replace&Reemplazar&Insert&InsertarTo UnitA unidadReplac&eRe&emplazarInser&tInser&tar&Close&CerrarUnit NameNombre de la unidadUnit TypeTipo de unidadCommentsComentarios[All][Todo]helpview&Back&Retroceder&Forward&Avanzar&Home&InicioFindBuscarFind &Previous&Buscar anteriorFind &NextBuscar &siguienteText string not foundCadena de texto que no se encuentranumeditError in unit data - %sError en los datos de las unidades - %sConverting...Convirtiendo...Units are not compatible (%s vs. %s)Las unidades no son compatibles (%s vs. %s)Set unitsSeleccionar unidadesNo Unit SetNinguna unidad seleccionadaError in unit data - {0}Error en los datos de las unidades - {0}Units are not compatible ({0} vs. {1})Las unidades no son compatibles ({0} vs. {1})optiondlg&OK&Aceptar&Cancel&CancelarPreferencesPreferenciasunitatomBad equation for "%s"Ecuación equivocada para "%s"Bad equation for "{0}"Ecuación equivocada para "{0}"unitdataCan not read "units.dat" fileNo se puede leer el archivo "units.dat"Duplicate unit names foundSe ha encontrado un nombre de unidad duplicadounitgroupCircular unit definitionDefinición de unidad circularInvalid conversion for "%s"Conversión no válida para "%s"Cannot combine non-linear unitsNo pueden combinarse unidades no linearesBad equation for %sEcuación equivocada para "%s"Invalid conversion for "{0}"Conversión no válida para "{0}"Bad equation for {0}Ecuación equivocada para "{0}"unitlistviewUnit NameNombre de la unidadUnit TypeTipo de unidadCommentsComentarios
ConvertAll/translations/convertall_es.qm 0000644 0001750 0001750 00000024035 12272340752 017535 0 ustar doug doug