Import Upstream version 2.5
Georges Khaznadar
4 years ago
0 | Jean-Baptiste BUTET <ashashiwa@gmail.com> | |
1 | Bastien <bgraviere@gmail.com> | |
2 | Georges Khaznadar <georgesk@ofset.org> |
0 | ||
1 | GNU GENERAL PUBLIC LICENSE | |
2 | Version 3, 29 June 2007 | |
3 | ||
4 | Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | |
5 | Everyone is permitted to copy and distribute verbatim copies | |
6 | of this license document, but changing it is not allowed. | |
7 | ||
8 | Preamble | |
9 | ||
10 | The GNU General Public License is a free, copyleft license for | |
11 | software and other kinds of works. | |
12 | ||
13 | The licenses for most software and other practical works are designed | |
14 | to take away your freedom to share and change the works. By contrast, | |
15 | the GNU General Public License is intended to guarantee your freedom to | |
16 | share and change all versions of a program--to make sure it remains free | |
17 | software for all its users. We, the Free Software Foundation, use the | |
18 | GNU General Public License for most of our software; it applies also to | |
19 | any other work released this way by its authors. You can apply it to | |
20 | your programs, too. | |
21 | ||
22 | When we speak of free software, we are referring to freedom, not | |
23 | price. Our General Public Licenses are designed to make sure that you | |
24 | have the freedom to distribute copies of free software (and charge for | |
25 | them if you wish), that you receive source code or can get it if you | |
26 | want it, that you can change the software or use pieces of it in new | |
27 | free programs, and that you know you can do these things. | |
28 | ||
29 | To protect your rights, we need to prevent others from denying you | |
30 | these rights or asking you to surrender the rights. Therefore, you have | |
31 | certain responsibilities if you distribute copies of the software, or if | |
32 | you modify it: responsibilities to respect the freedom of others. | |
33 | ||
34 | For example, if you distribute copies of such a program, whether | |
35 | gratis or for a fee, you must pass on to the recipients the same | |
36 | freedoms that you received. You must make sure that they, too, receive | |
37 | or can get the source code. And you must show them these terms so they | |
38 | know their rights. | |
39 | ||
40 | Developers that use the GNU GPL protect your rights with two steps: | |
41 | (1) assert copyright on the software, and (2) offer you this License | |
42 | giving you legal permission to copy, distribute and/or modify it. | |
43 | ||
44 | For the developers' and authors' protection, the GPL clearly explains | |
45 | that there is no warranty for this free software. For both users' and | |
46 | authors' sake, the GPL requires that modified versions be marked as | |
47 | changed, so that their problems will not be attributed erroneously to | |
48 | authors of previous versions. | |
49 | ||
50 | Some devices are designed to deny users access to install or run | |
51 | modified versions of the software inside them, although the manufacturer | |
52 | can do so. This is fundamentally incompatible with the aim of | |
53 | protecting users' freedom to change the software. The systematic | |
54 | pattern of such abuse occurs in the area of products for individuals to | |
55 | use, which is precisely where it is most unacceptable. Therefore, we | |
56 | have designed this version of the GPL to prohibit the practice for those | |
57 | products. If such problems arise substantially in other domains, we | |
58 | stand ready to extend this provision to those domains in future versions | |
59 | of the GPL, as needed to protect the freedom of users. | |
60 | ||
61 | Finally, every program is threatened constantly by software patents. | |
62 | States should not allow patents to restrict development and use of | |
63 | software on general-purpose computers, but in those that do, we wish to | |
64 | avoid the special danger that patents applied to a free program could | |
65 | make it effectively proprietary. To prevent this, the GPL assures that | |
66 | patents cannot be used to render the program non-free. | |
67 | ||
68 | The precise terms and conditions for copying, distribution and | |
69 | modification follow. | |
70 | ||
71 | TERMS AND CONDITIONS | |
72 | ||
73 | 0. Definitions. | |
74 | ||
75 | "This License" refers to version 3 of the GNU General Public License. | |
76 | ||
77 | "Copyright" also means copyright-like laws that apply to other kinds of | |
78 | works, such as semiconductor masks. | |
79 | ||
80 | "The Program" refers to any copyrightable work licensed under this | |
81 | License. Each licensee is addressed as "you". "Licensees" and | |
82 | "recipients" may be individuals or organizations. | |
83 | ||
84 | To "modify" a work means to copy from or adapt all or part of the work | |
85 | in a fashion requiring copyright permission, other than the making of an | |
86 | exact copy. The resulting work is called a "modified version" of the | |
87 | earlier work or a work "based on" the earlier work. | |
88 | ||
89 | A "covered work" means either the unmodified Program or a work based | |
90 | on the Program. | |
91 | ||
92 | To "propagate" a work means to do anything with it that, without | |
93 | permission, would make you directly or secondarily liable for | |
94 | infringement under applicable copyright law, except executing it on a | |
95 | computer or modifying a private copy. Propagation includes copying, | |
96 | distribution (with or without modification), making available to the | |
97 | public, and in some countries other activities as well. | |
98 | ||
99 | To "convey" a work means any kind of propagation that enables other | |
100 | parties to make or receive copies. Mere interaction with a user through | |
101 | a computer network, with no transfer of a copy, is not conveying. | |
102 | ||
103 | An interactive user interface displays "Appropriate Legal Notices" | |
104 | to the extent that it includes a convenient and prominently visible | |
105 | feature that (1) displays an appropriate copyright notice, and (2) | |
106 | tells the user that there is no warranty for the work (except to the | |
107 | extent that warranties are provided), that licensees may convey the | |
108 | work under this License, and how to view a copy of this License. If | |
109 | the interface presents a list of user commands or options, such as a | |
110 | menu, a prominent item in the list meets this criterion. | |
111 | ||
112 | 1. Source Code. | |
113 | ||
114 | The "source code" for a work means the preferred form of the work | |
115 | for making modifications to it. "Object code" means any non-source | |
116 | form of a work. | |
117 | ||
118 | A "Standard Interface" means an interface that either is an official | |
119 | standard defined by a recognized standards body, or, in the case of | |
120 | interfaces specified for a particular programming language, one that | |
121 | is widely used among developers working in that language. | |
122 | ||
123 | The "System Libraries" of an executable work include anything, other | |
124 | than the work as a whole, that (a) is included in the normal form of | |
125 | packaging a Major Component, but which is not part of that Major | |
126 | Component, and (b) serves only to enable use of the work with that | |
127 | Major Component, or to implement a Standard Interface for which an | |
128 | implementation is available to the public in source code form. A | |
129 | "Major Component", in this context, means a major essential component | |
130 | (kernel, window system, and so on) of the specific operating system | |
131 | (if any) on which the executable work runs, or a compiler used to | |
132 | produce the work, or an object code interpreter used to run it. | |
133 | ||
134 | The "Corresponding Source" for a work in object code form means all | |
135 | the source code needed to generate, install, and (for an executable | |
136 | work) run the object code and to modify the work, including scripts to | |
137 | control those activities. However, it does not include the work's | |
138 | System Libraries, or general-purpose tools or generally available free | |
139 | programs which are used unmodified in performing those activities but | |
140 | which are not part of the work. For example, Corresponding Source | |
141 | includes interface definition files associated with source files for | |
142 | the work, and the source code for shared libraries and dynamically | |
143 | linked subprograms that the work is specifically designed to require, | |
144 | such as by intimate data communication or control flow between those | |
145 | subprograms and other parts of the work. | |
146 | ||
147 | The Corresponding Source need not include anything that users | |
148 | can regenerate automatically from other parts of the Corresponding | |
149 | Source. | |
150 | ||
151 | The Corresponding Source for a work in source code form is that | |
152 | same work. | |
153 | ||
154 | 2. Basic Permissions. | |
155 | ||
156 | All rights granted under this License are granted for the term of | |
157 | copyright on the Program, and are irrevocable provided the stated | |
158 | conditions are met. This License explicitly affirms your unlimited | |
159 | permission to run the unmodified Program. The output from running a | |
160 | covered work is covered by this License only if the output, given its | |
161 | content, constitutes a covered work. This License acknowledges your | |
162 | rights of fair use or other equivalent, as provided by copyright law. | |
163 | ||
164 | You may make, run and propagate covered works that you do not | |
165 | convey, without conditions so long as your license otherwise remains | |
166 | in force. You may convey covered works to others for the sole purpose | |
167 | of having them make modifications exclusively for you, or provide you | |
168 | with facilities for running those works, provided that you comply with | |
169 | the terms of this License in conveying all material for which you do | |
170 | not control copyright. Those thus making or running the covered works | |
171 | for you must do so exclusively on your behalf, under your direction | |
172 | and control, on terms that prohibit them from making any copies of | |
173 | your copyrighted material outside their relationship with you. | |
174 | ||
175 | Conveying under any other circumstances is permitted solely under | |
176 | the conditions stated below. Sublicensing is not allowed; section 10 | |
177 | makes it unnecessary. | |
178 | ||
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. | |
180 | ||
181 | No covered work shall be deemed part of an effective technological | |
182 | measure under any applicable law fulfilling obligations under article | |
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or | |
184 | similar laws prohibiting or restricting circumvention of such | |
185 | measures. | |
186 | ||
187 | When you convey a covered work, you waive any legal power to forbid | |
188 | circumvention of technological measures to the extent such circumvention | |
189 | is effected by exercising rights under this License with respect to | |
190 | the covered work, and you disclaim any intention to limit operation or | |
191 | modification of the work as a means of enforcing, against the work's | |
192 | users, your or third parties' legal rights to forbid circumvention of | |
193 | technological measures. | |
194 | ||
195 | 4. Conveying Verbatim Copies. | |
196 | ||
197 | You may convey verbatim copies of the Program's source code as you | |
198 | receive it, in any medium, provided that you conspicuously and | |
199 | appropriately publish on each copy an appropriate copyright notice; | |
200 | keep intact all notices stating that this License and any | |
201 | non-permissive terms added in accord with section 7 apply to the code; | |
202 | keep intact all notices of the absence of any warranty; and give all | |
203 | recipients a copy of this License along with the Program. | |
204 | ||
205 | You may charge any price or no price for each copy that you convey, | |
206 | and you may offer support or warranty protection for a fee. | |
207 | ||
208 | 5. Conveying Modified Source Versions. | |
209 | ||
210 | You may convey a work based on the Program, or the modifications to | |
211 | produce it from the Program, in the form of source code under the | |
212 | terms of section 4, provided that you also meet all of these conditions: | |
213 | ||
214 | a) The work must carry prominent notices stating that you modified | |
215 | it, and giving a relevant date. | |
216 | ||
217 | b) The work must carry prominent notices stating that it is | |
218 | released under this License and any conditions added under section | |
219 | 7. This requirement modifies the requirement in section 4 to | |
220 | "keep intact all notices". | |
221 | ||
222 | c) You must license the entire work, as a whole, under this | |
223 | License to anyone who comes into possession of a copy. This | |
224 | License will therefore apply, along with any applicable section 7 | |
225 | additional terms, to the whole of the work, and all its parts, | |
226 | regardless of how they are packaged. This License gives no | |
227 | permission to license the work in any other way, but it does not | |
228 | invalidate such permission if you have separately received it. | |
229 | ||
230 | d) If the work has interactive user interfaces, each must display | |
231 | Appropriate Legal Notices; however, if the Program has interactive | |
232 | interfaces that do not display Appropriate Legal Notices, your | |
233 | work need not make them do so. | |
234 | ||
235 | A compilation of a covered work with other separate and independent | |
236 | works, which are not by their nature extensions of the covered work, | |
237 | and which are not combined with it such as to form a larger program, | |
238 | in or on a volume of a storage or distribution medium, is called an | |
239 | "aggregate" if the compilation and its resulting copyright are not | |
240 | used to limit the access or legal rights of the compilation's users | |
241 | beyond what the individual works permit. Inclusion of a covered work | |
242 | in an aggregate does not cause this License to apply to the other | |
243 | parts of the aggregate. | |
244 | ||
245 | 6. Conveying Non-Source Forms. | |
246 | ||
247 | You may convey a covered work in object code form under the terms | |
248 | of sections 4 and 5, provided that you also convey the | |
249 | machine-readable Corresponding Source under the terms of this License, | |
250 | in one of these ways: | |
251 | ||
252 | a) Convey the object code in, or embodied in, a physical product | |
253 | (including a physical distribution medium), accompanied by the | |
254 | Corresponding Source fixed on a durable physical medium | |
255 | customarily used for software interchange. | |
256 | ||
257 | b) Convey the object code in, or embodied in, a physical product | |
258 | (including a physical distribution medium), accompanied by a | |
259 | written offer, valid for at least three years and valid for as | |
260 | long as you offer spare parts or customer support for that product | |
261 | model, to give anyone who possesses the object code either (1) a | |
262 | copy of the Corresponding Source for all the software in the | |
263 | product that is covered by this License, on a durable physical | |
264 | medium customarily used for software interchange, for a price no | |
265 | more than your reasonable cost of physically performing this | |
266 | conveying of source, or (2) access to copy the | |
267 | Corresponding Source from a network server at no charge. | |
268 | ||
269 | c) Convey individual copies of the object code with a copy of the | |
270 | written offer to provide the Corresponding Source. This | |
271 | alternative is allowed only occasionally and noncommercially, and | |
272 | only if you received the object code with such an offer, in accord | |
273 | with subsection 6b. | |
274 | ||
275 | d) Convey the object code by offering access from a designated | |
276 | place (gratis or for a charge), and offer equivalent access to the | |
277 | Corresponding Source in the same way through the same place at no | |
278 | further charge. You need not require recipients to copy the | |
279 | Corresponding Source along with the object code. If the place to | |
280 | copy the object code is a network server, the Corresponding Source | |
281 | may be on a different server (operated by you or a third party) | |
282 | that supports equivalent copying facilities, provided you maintain | |
283 | clear directions next to the object code saying where to find the | |
284 | Corresponding Source. Regardless of what server hosts the | |
285 | Corresponding Source, you remain obligated to ensure that it is | |
286 | available for as long as needed to satisfy these requirements. | |
287 | ||
288 | e) Convey the object code using peer-to-peer transmission, provided | |
289 | you inform other peers where the object code and Corresponding | |
290 | Source of the work are being offered to the general public at no | |
291 | charge under subsection 6d. | |
292 | ||
293 | A separable portion of the object code, whose source code is excluded | |
294 | from the Corresponding Source as a System Library, need not be | |
295 | included in conveying the object code work. | |
296 | ||
297 | A "User Product" is either (1) a "consumer product", which means any | |
298 | tangible personal property which is normally used for personal, family, | |
299 | or household purposes, or (2) anything designed or sold for incorporation | |
300 | into a dwelling. In determining whether a product is a consumer product, | |
301 | doubtful cases shall be resolved in favor of coverage. For a particular | |
302 | product received by a particular user, "normally used" refers to a | |
303 | typical or common use of that class of product, regardless of the status | |
304 | of the particular user or of the way in which the particular user | |
305 | actually uses, or expects or is expected to use, the product. A product | |
306 | is a consumer product regardless of whether the product has substantial | |
307 | commercial, industrial or non-consumer uses, unless such uses represent | |
308 | the only significant mode of use of the product. | |
309 | ||
310 | "Installation Information" for a User Product means any methods, | |
311 | procedures, authorization keys, or other information required to install | |
312 | and execute modified versions of a covered work in that User Product from | |
313 | a modified version of its Corresponding Source. The information must | |
314 | suffice to ensure that the continued functioning of the modified object | |
315 | code is in no case prevented or interfered with solely because | |
316 | modification has been made. | |
317 | ||
318 | If you convey an object code work under this section in, or with, or | |
319 | specifically for use in, a User Product, and the conveying occurs as | |
320 | part of a transaction in which the right of possession and use of the | |
321 | User Product is transferred to the recipient in perpetuity or for a | |
322 | fixed term (regardless of how the transaction is characterized), the | |
323 | Corresponding Source conveyed under this section must be accompanied | |
324 | by the Installation Information. But this requirement does not apply | |
325 | if neither you nor any third party retains the ability to install | |
326 | modified object code on the User Product (for example, the work has | |
327 | been installed in ROM). | |
328 | ||
329 | The requirement to provide Installation Information does not include a | |
330 | requirement to continue to provide support service, warranty, or updates | |
331 | for a work that has been modified or installed by the recipient, or for | |
332 | the User Product in which it has been modified or installed. Access to a | |
333 | network may be denied when the modification itself materially and | |
334 | adversely affects the operation of the network or violates the rules and | |
335 | protocols for communication across the network. | |
336 | ||
337 | Corresponding Source conveyed, and Installation Information provided, | |
338 | in accord with this section must be in a format that is publicly | |
339 | documented (and with an implementation available to the public in | |
340 | source code form), and must require no special password or key for | |
341 | unpacking, reading or copying. | |
342 | ||
343 | 7. Additional Terms. | |
344 | ||
345 | "Additional permissions" are terms that supplement the terms of this | |
346 | License by making exceptions from one or more of its conditions. | |
347 | Additional permissions that are applicable to the entire Program shall | |
348 | be treated as though they were included in this License, to the extent | |
349 | that they are valid under applicable law. If additional permissions | |
350 | apply only to part of the Program, that part may be used separately | |
351 | under those permissions, but the entire Program remains governed by | |
352 | this License without regard to the additional permissions. | |
353 | ||
354 | When you convey a copy of a covered work, you may at your option | |
355 | remove any additional permissions from that copy, or from any part of | |
356 | it. (Additional permissions may be written to require their own | |
357 | removal in certain cases when you modify the work.) You may place | |
358 | additional permissions on material, added by you to a covered work, | |
359 | for which you have or can give appropriate copyright permission. | |
360 | ||
361 | Notwithstanding any other provision of this License, for material you | |
362 | add to a covered work, you may (if authorized by the copyright holders of | |
363 | that material) supplement the terms of this License with terms: | |
364 | ||
365 | a) Disclaiming warranty or limiting liability differently from the | |
366 | terms of sections 15 and 16 of this License; or | |
367 | ||
368 | b) Requiring preservation of specified reasonable legal notices or | |
369 | author attributions in that material or in the Appropriate Legal | |
370 | Notices displayed by works containing it; or | |
371 | ||
372 | c) Prohibiting misrepresentation of the origin of that material, or | |
373 | requiring that modified versions of such material be marked in | |
374 | reasonable ways as different from the original version; or | |
375 | ||
376 | d) Limiting the use for publicity purposes of names of licensors or | |
377 | authors of the material; or | |
378 | ||
379 | e) Declining to grant rights under trademark law for use of some | |
380 | trade names, trademarks, or service marks; or | |
381 | ||
382 | f) Requiring indemnification of licensors and authors of that | |
383 | material by anyone who conveys the material (or modified versions of | |
384 | it) with contractual assumptions of liability to the recipient, for | |
385 | any liability that these contractual assumptions directly impose on | |
386 | those licensors and authors. | |
387 | ||
388 | All other non-permissive additional terms are considered "further | |
389 | restrictions" within the meaning of section 10. If the Program as you | |
390 | received it, or any part of it, contains a notice stating that it is | |
391 | governed by this License along with a term that is a further | |
392 | restriction, you may remove that term. If a license document contains | |
393 | a further restriction but permits relicensing or conveying under this | |
394 | License, you may add to a covered work material governed by the terms | |
395 | of that license document, provided that the further restriction does | |
396 | not survive such relicensing or conveying. | |
397 | ||
398 | If you add terms to a covered work in accord with this section, you | |
399 | must place, in the relevant source files, a statement of the | |
400 | additional terms that apply to those files, or a notice indicating | |
401 | where to find the applicable terms. | |
402 | ||
403 | Additional terms, permissive or non-permissive, may be stated in the | |
404 | form of a separately written license, or stated as exceptions; | |
405 | the above requirements apply either way. | |
406 | ||
407 | 8. Termination. | |
408 | ||
409 | You may not propagate or modify a covered work except as expressly | |
410 | provided under this License. Any attempt otherwise to propagate or | |
411 | modify it is void, and will automatically terminate your rights under | |
412 | this License (including any patent licenses granted under the third | |
413 | paragraph of section 11). | |
414 | ||
415 | However, if you cease all violation of this License, then your | |
416 | license from a particular copyright holder is reinstated (a) | |
417 | provisionally, unless and until the copyright holder explicitly and | |
418 | finally terminates your license, and (b) permanently, if the copyright | |
419 | holder fails to notify you of the violation by some reasonable means | |
420 | prior to 60 days after the cessation. | |
421 | ||
422 | Moreover, your license from a particular copyright holder is | |
423 | reinstated permanently if the copyright holder notifies you of the | |
424 | violation by some reasonable means, this is the first time you have | |
425 | received notice of violation of this License (for any work) from that | |
426 | copyright holder, and you cure the violation prior to 30 days after | |
427 | your receipt of the notice. | |
428 | ||
429 | Termination of your rights under this section does not terminate the | |
430 | licenses of parties who have received copies or rights from you under | |
431 | this License. If your rights have been terminated and not permanently | |
432 | reinstated, you do not qualify to receive new licenses for the same | |
433 | material under section 10. | |
434 | ||
435 | 9. Acceptance Not Required for Having Copies. | |
436 | ||
437 | You are not required to accept this License in order to receive or | |
438 | run a copy of the Program. Ancillary propagation of a covered work | |
439 | occurring solely as a consequence of using peer-to-peer transmission | |
440 | to receive a copy likewise does not require acceptance. However, | |
441 | nothing other than this License grants you permission to propagate or | |
442 | modify any covered work. These actions infringe copyright if you do | |
443 | not accept this License. Therefore, by modifying or propagating a | |
444 | covered work, you indicate your acceptance of this License to do so. | |
445 | ||
446 | 10. Automatic Licensing of Downstream Recipients. | |
447 | ||
448 | Each time you convey a covered work, the recipient automatically | |
449 | receives a license from the original licensors, to run, modify and | |
450 | propagate that work, subject to this License. You are not responsible | |
451 | for enforcing compliance by third parties with this License. | |
452 | ||
453 | An "entity transaction" is a transaction transferring control of an | |
454 | organization, or substantially all assets of one, or subdividing an | |
455 | organization, or merging organizations. If propagation of a covered | |
456 | work results from an entity transaction, each party to that | |
457 | transaction who receives a copy of the work also receives whatever | |
458 | licenses to the work the party's predecessor in interest had or could | |
459 | give under the previous paragraph, plus a right to possession of the | |
460 | Corresponding Source of the work from the predecessor in interest, if | |
461 | the predecessor has it or can get it with reasonable efforts. | |
462 | ||
463 | You may not impose any further restrictions on the exercise of the | |
464 | rights granted or affirmed under this License. For example, you may | |
465 | not impose a license fee, royalty, or other charge for exercise of | |
466 | rights granted under this License, and you may not initiate litigation | |
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that | |
468 | any patent claim is infringed by making, using, selling, offering for | |
469 | sale, or importing the Program or any portion of it. | |
470 | ||
471 | 11. Patents. | |
472 | ||
473 | A "contributor" is a copyright holder who authorizes use under this | |
474 | License of the Program or a work on which the Program is based. The | |
475 | work thus licensed is called the contributor's "contributor version". | |
476 | ||
477 | A contributor's "essential patent claims" are all patent claims | |
478 | owned or controlled by the contributor, whether already acquired or | |
479 | hereafter acquired, that would be infringed by some manner, permitted | |
480 | by this License, of making, using, or selling its contributor version, | |
481 | but do not include claims that would be infringed only as a | |
482 | consequence of further modification of the contributor version. For | |
483 | purposes of this definition, "control" includes the right to grant | |
484 | patent sublicenses in a manner consistent with the requirements of | |
485 | this License. | |
486 | ||
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free | |
488 | patent license under the contributor's essential patent claims, to | |
489 | make, use, sell, offer for sale, import and otherwise run, modify and | |
490 | propagate the contents of its contributor version. | |
491 | ||
492 | In the following three paragraphs, a "patent license" is any express | |
493 | agreement or commitment, however denominated, not to enforce a patent | |
494 | (such as an express permission to practice a patent or covenant not to | |
495 | sue for patent infringement). To "grant" such a patent license to a | |
496 | party means to make such an agreement or commitment not to enforce a | |
497 | patent against the party. | |
498 | ||
499 | If you convey a covered work, knowingly relying on a patent license, | |
500 | and the Corresponding Source of the work is not available for anyone | |
501 | to copy, free of charge and under the terms of this License, through a | |
502 | publicly available network server or other readily accessible means, | |
503 | then you must either (1) cause the Corresponding Source to be so | |
504 | available, or (2) arrange to deprive yourself of the benefit of the | |
505 | patent license for this particular work, or (3) arrange, in a manner | |
506 | consistent with the requirements of this License, to extend the patent | |
507 | license to downstream recipients. "Knowingly relying" means you have | |
508 | actual knowledge that, but for the patent license, your conveying the | |
509 | covered work in a country, or your recipient's use of the covered work | |
510 | in a country, would infringe one or more identifiable patents in that | |
511 | country that you have reason to believe are valid. | |
512 | ||
513 | If, pursuant to or in connection with a single transaction or | |
514 | arrangement, you convey, or propagate by procuring conveyance of, a | |
515 | covered work, and grant a patent license to some of the parties | |
516 | receiving the covered work authorizing them to use, propagate, modify | |
517 | or convey a specific copy of the covered work, then the patent license | |
518 | you grant is automatically extended to all recipients of the covered | |
519 | work and works based on it. | |
520 | ||
521 | A patent license is "discriminatory" if it does not include within | |
522 | the scope of its coverage, prohibits the exercise of, or is | |
523 | conditioned on the non-exercise of one or more of the rights that are | |
524 | specifically granted under this License. You may not convey a covered | |
525 | work if you are a party to an arrangement with a third party that is | |
526 | in the business of distributing software, under which you make payment | |
527 | to the third party based on the extent of your activity of conveying | |
528 | the work, and under which the third party grants, to any of the | |
529 | parties who would receive the covered work from you, a discriminatory | |
530 | patent license (a) in connection with copies of the covered work | |
531 | conveyed by you (or copies made from those copies), or (b) primarily | |
532 | for and in connection with specific products or compilations that | |
533 | contain the covered work, unless you entered into that arrangement, | |
534 | or that patent license was granted, prior to 28 March 2007. | |
535 | ||
536 | Nothing in this License shall be construed as excluding or limiting | |
537 | any implied license or other defenses to infringement that may | |
538 | otherwise be available to you under applicable patent law. | |
539 | ||
540 | 12. No Surrender of Others' Freedom. | |
541 | ||
542 | If conditions are imposed on you (whether by court order, agreement or | |
543 | otherwise) that contradict the conditions of this License, they do not | |
544 | excuse you from the conditions of this License. If you cannot convey a | |
545 | covered work so as to satisfy simultaneously your obligations under this | |
546 | License and any other pertinent obligations, then as a consequence you may | |
547 | not convey it at all. For example, if you agree to terms that obligate you | |
548 | to collect a royalty for further conveying from those to whom you convey | |
549 | the Program, the only way you could satisfy both those terms and this | |
550 | License would be to refrain entirely from conveying the Program. | |
551 | ||
552 | 13. Use with the GNU Affero General Public License. | |
553 | ||
554 | Notwithstanding any other provision of this License, you have | |
555 | permission to link or combine any covered work with a work licensed | |
556 | under version 3 of the GNU Affero General Public License into a single | |
557 | combined work, and to convey the resulting work. The terms of this | |
558 | License will continue to apply to the part which is the covered work, | |
559 | but the special requirements of the GNU Affero General Public License, | |
560 | section 13, concerning interaction through a network will apply to the | |
561 | combination as such. | |
562 | ||
563 | 14. Revised Versions of this License. | |
564 | ||
565 | The Free Software Foundation may publish revised and/or new versions of | |
566 | the GNU General Public License from time to time. Such new versions will | |
567 | be similar in spirit to the present version, but may differ in detail to | |
568 | address new problems or concerns. | |
569 | ||
570 | Each version is given a distinguishing version number. If the | |
571 | Program specifies that a certain numbered version of the GNU General | |
572 | Public License "or any later version" applies to it, you have the | |
573 | option of following the terms and conditions either of that numbered | |
574 | version or of any later version published by the Free Software | |
575 | Foundation. If the Program does not specify a version number of the | |
576 | GNU General Public License, you may choose any version ever published | |
577 | by the Free Software Foundation. | |
578 | ||
579 | If the Program specifies that a proxy can decide which future | |
580 | versions of the GNU General Public License can be used, that proxy's | |
581 | public statement of acceptance of a version permanently authorizes you | |
582 | to choose that version for the Program. | |
583 | ||
584 | Later license versions may give you additional or different | |
585 | permissions. However, no additional obligations are imposed on any | |
586 | author or copyright holder as a result of your choosing to follow a | |
587 | later version. | |
588 | ||
589 | 15. Disclaimer of Warranty. | |
590 | ||
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | |
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | |
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY | |
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, | |
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM | |
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF | |
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |
599 | ||
600 | 16. Limitation of Liability. | |
601 | ||
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS | |
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY | |
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE | |
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF | |
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD | |
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), | |
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | |
610 | SUCH DAMAGES. | |
611 | ||
612 | 17. Interpretation of Sections 15 and 16. | |
613 | ||
614 | If the disclaimer of warranty and limitation of liability provided | |
615 | above cannot be given local legal effect according to their terms, | |
616 | reviewing courts shall apply local law that most closely approximates | |
617 | an absolute waiver of all civil liability in connection with the | |
618 | Program, unless a warranty or assumption of liability accompanies a | |
619 | copy of the Program in return for a fee. | |
620 | ||
621 | END OF TERMS AND CONDITIONS | |
622 | ||
623 | How to Apply These Terms to Your New Programs | |
624 | ||
625 | If you develop a new program, and you want it to be of the greatest | |
626 | possible use to the public, the best way to achieve this is to make it | |
627 | free software which everyone can redistribute and change under these terms. | |
628 | ||
629 | To do so, attach the following notices to the program. It is safest | |
630 | to attach them to the start of each source file to most effectively | |
631 | state the exclusion of warranty; and each file should have at least | |
632 | the "copyright" line and a pointer to where the full notice is found. | |
633 | ||
634 | <one line to give the program's name and a brief idea of what it does.> | |
635 | Copyright (C) <year> <name of author> | |
636 | ||
637 | This program is free software: you can redistribute it and/or modify | |
638 | it under the terms of the GNU General Public License as published by | |
639 | the Free Software Foundation, either version 3 of the License, or | |
640 | (at your option) any later version. | |
641 | ||
642 | This program is distributed in the hope that it will be useful, | |
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
645 | GNU General Public License for more details. | |
646 | ||
647 | You should have received a copy of the GNU General Public License | |
648 | along with this program. If not, see <http://www.gnu.org/licenses/>. | |
649 | ||
650 | Also add information on how to contact you by electronic and paper mail. | |
651 | ||
652 | If the program does terminal interaction, make it output a short | |
653 | notice like this when it starts in an interactive mode: | |
654 | ||
655 | <program> Copyright (C) <year> <name of author> | |
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
657 | This is free software, and you are welcome to redistribute it | |
658 | under certain conditions; type `show c' for details. | |
659 | ||
660 | The hypothetical commands `show w' and `show c' should show the appropriate | |
661 | parts of the General Public License. Of course, your program's commands | |
662 | might be different; for a GUI interface, you would use an "about box". | |
663 | ||
664 | You should also get your employer (if you work as a programmer) or school, | |
665 | if any, to sign a "copyright disclaimer" for the program, if necessary. | |
666 | For more information on this, and how to apply and follow the GNU GPL, see | |
667 | <http://www.gnu.org/licenses/>. | |
668 | ||
669 | The GNU General Public License does not permit incorporating your program | |
670 | into proprietary programs. If your program is a subroutine library, you | |
671 | may consider it more useful to permit linking proprietary applications with | |
672 | the library. If this is what you want to do, use the GNU Lesser General | |
673 | Public License instead of this License. But first, please read | |
674 | <http://www.gnu.org/philosophy/why-not-lgpl.html>. | |
675 |
0 | JB : Jean-Baptiste BUTET | |
1 | BG : Bastient GRAVIERE | |
2 | GK : Georges Khaznadar | |
3 | ||
4 | 2008-03-12 : JB, interface graphique. | |
5 | 2008-04-08 : GK, méthode d'intégration, validation avec un champ de gravité | |
6 | terrestre. | |
7 | 2008-04-11 : GK, modification de la fonction verifie_et_traduit afin de | |
8 | faciliter l'entrée d'expressions complètes. Par exemple on peut | |
9 | rentrer 2*3.14*(35786+6400)*1000/24/3600 comme vitesse | |
10 | tangentielle d'un satellite géostationnaire, et on voit bien | |
11 | l'orbite circulaire se construire. | |
12 | 2008-04-11 : GK, calcul de la période de révolution, dans le cas où l'énergie | |
13 | mécanique Em est négative, par la méthode suivante (k=mMG) : | |
14 | - calcul du grand axe : a = - k/2Em | |
15 | - calcul de la période : T = 2pi(a³/k)^0.5 | |
16 | 2008-04-12 : GK, mise en place d'une liste d'astres à l'aide de Wikipedia | |
17 | et intégration avec l'application xplanet et les textures de | |
18 | celestia pour tracer l'image de la planète. Changé les appels | |
19 | à print pour tracer le programme en appels valués à self.debug | |
20 | Changement de quelques widgets : combo pour choisir l'astre, | |
21 | renseignements pour le comparer à la Terre. | |
22 | 2008-04-15 : GK, correction de la prise des données de vitesse. Redressé | |
23 | l'axe Oy. Activé les graphiques pour Vx et Vy. Ajouté une | |
24 | fonction d'agrandissement pour les graphiques. | |
25 | 2008-04-20 : GK, correction de problèmes avec le tracé et l'effacement de | |
26 | points de la trajectoire, quelques changements de style, | |
27 | amélioration des graphiques agrandis, implémenté le cas des | |
28 | énergies mécaniques positives. Ajouté le traitement d'options | |
29 | en ligne de commande. Réglé la gestion des chemins d'accès aux | |
30 | répertoires. | |
31 | 2008-04-26 : GK, ajout de support pour créer une vidéo vue du satellite. | |
32 | la vitesse initiale Vx a été réglée négative, pour un lancer | |
33 | vers l'est. Séparation du code de vérification/calcul de | |
34 | nombres flottants.⏎ |
0 | Le logiciel pysatellites permet de simuler le lancement d'un satellite | |
1 | autour de nombreux astres connus. C'est un logiciel libre, diffusé sous | |
2 | la licence GPL version 3. Voyez les fichiers COPYING Changelog et AUTHORS | |
3 | ||
4 | Pour être pleinement fonctionnel, il est préférable d'installer en même | |
5 | temps les logiciels libres xplanet et la base de données du logiciel celestia | |
6 | ;) de toute façon, une personne intéressée par pysatellites sera très | |
7 | probablement aussi intéressée par xplanet et celestia, pour de nombreux | |
8 | usages complémentaires. | |
9 | ||
10 | Certaines formules sont utilisées pour faciliter la simulation : | |
11 | - la méthode d'intégration de Runge-Kutta qui est d'ordre 4, beaucoup | |
12 | pkus efficace que al méthode d'Euler | |
13 | - un calcul des paramètres de la trajectoire à partir des données connues | |
14 | dès le lancement : énergie mécanique, grand axe, excentricité, période, | |
15 | etc. | |
16 | ||
17 | Le fondement théorique des méthodes emplyées est décrit dans le fichier | |
18 | methodes.tm, qui s'ouvre à l'aide du logiciel libre TexMacs. |
0 | DESTDIR = | |
1 | ||
2 | STELLARIUM_TEXTURES = /usr/share/stellarium/textures | |
3 | ||
4 | all: user-interface pysatellites.1 | |
5 | ||
6 | pysatellites.1: manpage.xml | |
7 | xsltproc --nonet /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl manpage.xml | |
8 | ||
9 | clean: | |
10 | rm -f *~ *.pyc | |
11 | rm -f UI_* | |
12 | rm -rf build | |
13 | ||
14 | user-interface: UI_pysat.py UI_graphe.py | |
15 | ||
16 | UI_%.py: %.ui | |
17 | pyuic4 $< -o $@ | |
18 | ||
19 | install: all | |
20 | mkdir -p $(DESTDIR)/usr/bin | |
21 | install -m 755 pysatellites $(DESTDIR)/usr/bin | |
22 | mkdir -p $(DESTDIR)/usr/share/applications | |
23 | install -m 644 pysatellites.desktop $(DESTDIR)/usr/share/applications | |
24 | mkdir -p $(DESTDIR)/usr/share/pysatellites | |
25 | install -m 644 *.py $(DESTDIR)/usr/share/pysatellites | |
26 | cp -a icones $(DESTDIR)/usr/share/pysatellites | |
27 | # install images from stellarium-data; | |
28 | # stellarium-data is not necessary later. | |
29 | mkdir -p $(DESTDIR)/usr/share/pysatellites/images | |
30 | for d in $(STELLARIUM_TEXTURES); do \ | |
31 | for f in $$(ls $$d/*.png); do \ | |
32 | g=$(DESTDIR)/usr/share/pysatellites/images/$$(echo $$(basename $$f)| sed -e 's/png/jpg/'); \ | |
33 | convert $$f $$g; \ | |
34 | done; \ | |
35 | done | |
36 | ||
37 | ||
38 | .PHONY = user-interface install clean install-textures all install-for-debian |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
0 | # -*- coding: utf-8 -*- | |
1 | """La plupart de ces données ont été adaptées à partir de la version | |
2 | anglaise de Wikipedia : http://en.wikipedia.org | |
3 | """ | |
4 | ||
5 | from flottant import traduit | |
6 | ||
7 | astreNom=[ | |
8 | # nom_local, nom_stellarium, masse_kg, rayon_km, commentaire, jour, flipped | |
9 | # flipped fait référence à une propréiété dans le fichier Planet.cpp | |
10 | # de src/libplanet du logiciel xplanet. | |
11 | ||
12 | ["Terre","earth-clouds","6x10^24","6400","Planète du système solaire","1","1"], | |
13 | ["Soleil","sun","6x10^31","695000","Étoile du système solaire","26","1"], | |
14 | ["Lune","moon","7.33x10^22","1740","Lune de Terre","27.3216","1"], | |
15 | ["Amalthée","amalthea","2.08x10^18","83.5","Lune de Jupiter","0.49817943","-1"], | |
16 | ["Callisto","callisto","1.076x10^23 ","2410","Lune de Jupiter","16.6890184","-1"], | |
17 | ["Deimos","deimos","1.48x10^15","6.2","Lune de Mars","1.26244","-1"], | |
18 | ["Dione","dione","1.1x10^21","561","Lune de Saturne","2.736915","-1"], | |
19 | ["Encelade","enceladus","1.08x10^20","252","Lune de Saturne","1.370218","-1"], | |
20 | ["Épiméthée","epimetheus","57","5.3x10^17","Lune de Saturne","0.694333517","-1"], | |
21 | ["Europe","europa","4.80x10^22","1569","Lune de Jupiter","3.551181","-1"], | |
22 | ["Ganymède","ganymede","1.4819x10^23","2634","Lune de Jupiter","7.15455296","-1"], | |
23 | ["Hyperion","hyperion","0.558x10^19","280","Lune de Saturne","21.27661","-1"], | |
24 | ["Iapète","iapetus","1.80x10^21","1450","Lune de Saturne","79.3215","-1"], | |
25 | ["Io","io","8.9319x10^22","1821.3","Lune de Jupiter","1.769137786","-1"], | |
26 | ["Janus","janus","1.91x10^18","173","Lune de Saturne","0.694660342","-1"], | |
27 | ["Jupiter","jupiter","1.90x10^27 ","70x10^3","Planète du système solaire","9.925/24","-1"], | |
28 | ["Mars","mars","6.4185x10^23","3390","Planète du système solaire","1.025957","-1"], | |
29 | ["Mercure","mercury","3.3022x10^23","2440","Planète du système solaire","58.646","-1"], | |
30 | ["Mimas","mimas","3.7493x10^19","390","Lune de Saturne","0.9424218 ","-1"], | |
31 | ["Miranda","miranda","6.59x10^19","470","Lune d'Uranus","1.413479","1"], | |
32 | ["Neptune","neptune","1.0243x10^26","24750","Planète du système solaire","0.6713","-1"], | |
33 | ["Obéron","oberon","3.014x10^21","761.4","Lune d'Uranus","13.463234","1"], | |
34 | ["Phobos","phobos","1.07x10^16","11.1","Lune de Mars","0.318 910 23","-1"], | |
35 | ["Pluton","pluto","1.30x10^22","1195","Planète du système solaire","-6.387230","1"], | |
36 | ["Prométhée","prometheus","1.566x10^17","100","Lune de Saturne","0.612990038","-1"], | |
37 | ["Protée","proteus","4.4x10^19","410","Lune de Neptune","1.12231477","-1"], | |
38 | ["Rhéa","rhea","2.3065x10^21","1525","Lune de Saturne","4.518212","-1"], | |
39 | ["Saturne","saturn","5.6846x10^26","60x10^3","Planète du système solaire","0.445","-1"], | |
40 | ["Tethys","tethys","6.174x10^20","1060","Lune de Saturne","1.887802","-1"], | |
41 | ["Titan","titan","1.345x10^23","2576","Lune de Saturne","15.945","-1"], | |
42 | ["Triton","triton","2.14x10^22","1353","Lune de Neptune","-5.877","-1"], | |
43 | ["Umbriel","umbriel","1.2x10^21","1169","Lune d'Uranus","4.144","1"], | |
44 | ["Vénus","venus","4.8685x10^24","6051","Planète du système solaire","-243.0185","1"] | |
45 | ] | |
46 | ||
47 | class Astre: | |
48 | def __init__(self,cle): | |
49 | for a in astreNom: | |
50 | if a[1]==cle: break | |
51 | self.nom=a[0] | |
52 | self.cle=cle | |
53 | self.masse=traduit(a[2]) | |
54 | self.rayon=1000*traduit(a[3]) | |
55 | self.commentaire=a[4] | |
56 | self.rotationSiderale=a[5] #unité jour | |
57 | self.flip=a[6] |
0 | Jean-Baptiste BUTET <ashashiwa@gmail.com> | |
1 | Bastien <bgraviere@gmail.com> | |
2 | Georges Khaznadar <georgesk@ofset.org> |
0 | ||
1 | GNU GENERAL PUBLIC LICENSE | |
2 | Version 3, 29 June 2007 | |
3 | ||
4 | Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | |
5 | Everyone is permitted to copy and distribute verbatim copies | |
6 | of this license document, but changing it is not allowed. | |
7 | ||
8 | Preamble | |
9 | ||
10 | The GNU General Public License is a free, copyleft license for | |
11 | software and other kinds of works. | |
12 | ||
13 | The licenses for most software and other practical works are designed | |
14 | to take away your freedom to share and change the works. By contrast, | |
15 | the GNU General Public License is intended to guarantee your freedom to | |
16 | share and change all versions of a program--to make sure it remains free | |
17 | software for all its users. We, the Free Software Foundation, use the | |
18 | GNU General Public License for most of our software; it applies also to | |
19 | any other work released this way by its authors. You can apply it to | |
20 | your programs, too. | |
21 | ||
22 | When we speak of free software, we are referring to freedom, not | |
23 | price. Our General Public Licenses are designed to make sure that you | |
24 | have the freedom to distribute copies of free software (and charge for | |
25 | them if you wish), that you receive source code or can get it if you | |
26 | want it, that you can change the software or use pieces of it in new | |
27 | free programs, and that you know you can do these things. | |
28 | ||
29 | To protect your rights, we need to prevent others from denying you | |
30 | these rights or asking you to surrender the rights. Therefore, you have | |
31 | certain responsibilities if you distribute copies of the software, or if | |
32 | you modify it: responsibilities to respect the freedom of others. | |
33 | ||
34 | For example, if you distribute copies of such a program, whether | |
35 | gratis or for a fee, you must pass on to the recipients the same | |
36 | freedoms that you received. You must make sure that they, too, receive | |
37 | or can get the source code. And you must show them these terms so they | |
38 | know their rights. | |
39 | ||
40 | Developers that use the GNU GPL protect your rights with two steps: | |
41 | (1) assert copyright on the software, and (2) offer you this License | |
42 | giving you legal permission to copy, distribute and/or modify it. | |
43 | ||
44 | For the developers' and authors' protection, the GPL clearly explains | |
45 | that there is no warranty for this free software. For both users' and | |
46 | authors' sake, the GPL requires that modified versions be marked as | |
47 | changed, so that their problems will not be attributed erroneously to | |
48 | authors of previous versions. | |
49 | ||
50 | Some devices are designed to deny users access to install or run | |
51 | modified versions of the software inside them, although the manufacturer | |
52 | can do so. This is fundamentally incompatible with the aim of | |
53 | protecting users' freedom to change the software. The systematic | |
54 | pattern of such abuse occurs in the area of products for individuals to | |
55 | use, which is precisely where it is most unacceptable. Therefore, we | |
56 | have designed this version of the GPL to prohibit the practice for those | |
57 | products. If such problems arise substantially in other domains, we | |
58 | stand ready to extend this provision to those domains in future versions | |
59 | of the GPL, as needed to protect the freedom of users. | |
60 | ||
61 | Finally, every program is threatened constantly by software patents. | |
62 | States should not allow patents to restrict development and use of | |
63 | software on general-purpose computers, but in those that do, we wish to | |
64 | avoid the special danger that patents applied to a free program could | |
65 | make it effectively proprietary. To prevent this, the GPL assures that | |
66 | patents cannot be used to render the program non-free. | |
67 | ||
68 | The precise terms and conditions for copying, distribution and | |
69 | modification follow. | |
70 | ||
71 | TERMS AND CONDITIONS | |
72 | ||
73 | 0. Definitions. | |
74 | ||
75 | "This License" refers to version 3 of the GNU General Public License. | |
76 | ||
77 | "Copyright" also means copyright-like laws that apply to other kinds of | |
78 | works, such as semiconductor masks. | |
79 | ||
80 | "The Program" refers to any copyrightable work licensed under this | |
81 | License. Each licensee is addressed as "you". "Licensees" and | |
82 | "recipients" may be individuals or organizations. | |
83 | ||
84 | To "modify" a work means to copy from or adapt all or part of the work | |
85 | in a fashion requiring copyright permission, other than the making of an | |
86 | exact copy. The resulting work is called a "modified version" of the | |
87 | earlier work or a work "based on" the earlier work. | |
88 | ||
89 | A "covered work" means either the unmodified Program or a work based | |
90 | on the Program. | |
91 | ||
92 | To "propagate" a work means to do anything with it that, without | |
93 | permission, would make you directly or secondarily liable for | |
94 | infringement under applicable copyright law, except executing it on a | |
95 | computer or modifying a private copy. Propagation includes copying, | |
96 | distribution (with or without modification), making available to the | |
97 | public, and in some countries other activities as well. | |
98 | ||
99 | To "convey" a work means any kind of propagation that enables other | |
100 | parties to make or receive copies. Mere interaction with a user through | |
101 | a computer network, with no transfer of a copy, is not conveying. | |
102 | ||
103 | An interactive user interface displays "Appropriate Legal Notices" | |
104 | to the extent that it includes a convenient and prominently visible | |
105 | feature that (1) displays an appropriate copyright notice, and (2) | |
106 | tells the user that there is no warranty for the work (except to the | |
107 | extent that warranties are provided), that licensees may convey the | |
108 | work under this License, and how to view a copy of this License. If | |
109 | the interface presents a list of user commands or options, such as a | |
110 | menu, a prominent item in the list meets this criterion. | |
111 | ||
112 | 1. Source Code. | |
113 | ||
114 | The "source code" for a work means the preferred form of the work | |
115 | for making modifications to it. "Object code" means any non-source | |
116 | form of a work. | |
117 | ||
118 | A "Standard Interface" means an interface that either is an official | |
119 | standard defined by a recognized standards body, or, in the case of | |
120 | interfaces specified for a particular programming language, one that | |
121 | is widely used among developers working in that language. | |
122 | ||
123 | The "System Libraries" of an executable work include anything, other | |
124 | than the work as a whole, that (a) is included in the normal form of | |
125 | packaging a Major Component, but which is not part of that Major | |
126 | Component, and (b) serves only to enable use of the work with that | |
127 | Major Component, or to implement a Standard Interface for which an | |
128 | implementation is available to the public in source code form. A | |
129 | "Major Component", in this context, means a major essential component | |
130 | (kernel, window system, and so on) of the specific operating system | |
131 | (if any) on which the executable work runs, or a compiler used to | |
132 | produce the work, or an object code interpreter used to run it. | |
133 | ||
134 | The "Corresponding Source" for a work in object code form means all | |
135 | the source code needed to generate, install, and (for an executable | |
136 | work) run the object code and to modify the work, including scripts to | |
137 | control those activities. However, it does not include the work's | |
138 | System Libraries, or general-purpose tools or generally available free | |
139 | programs which are used unmodified in performing those activities but | |
140 | which are not part of the work. For example, Corresponding Source | |
141 | includes interface definition files associated with source files for | |
142 | the work, and the source code for shared libraries and dynamically | |
143 | linked subprograms that the work is specifically designed to require, | |
144 | such as by intimate data communication or control flow between those | |
145 | subprograms and other parts of the work. | |
146 | ||
147 | The Corresponding Source need not include anything that users | |
148 | can regenerate automatically from other parts of the Corresponding | |
149 | Source. | |
150 | ||
151 | The Corresponding Source for a work in source code form is that | |
152 | same work. | |
153 | ||
154 | 2. Basic Permissions. | |
155 | ||
156 | All rights granted under this License are granted for the term of | |
157 | copyright on the Program, and are irrevocable provided the stated | |
158 | conditions are met. This License explicitly affirms your unlimited | |
159 | permission to run the unmodified Program. The output from running a | |
160 | covered work is covered by this License only if the output, given its | |
161 | content, constitutes a covered work. This License acknowledges your | |
162 | rights of fair use or other equivalent, as provided by copyright law. | |
163 | ||
164 | You may make, run and propagate covered works that you do not | |
165 | convey, without conditions so long as your license otherwise remains | |
166 | in force. You may convey covered works to others for the sole purpose | |
167 | of having them make modifications exclusively for you, or provide you | |
168 | with facilities for running those works, provided that you comply with | |
169 | the terms of this License in conveying all material for which you do | |
170 | not control copyright. Those thus making or running the covered works | |
171 | for you must do so exclusively on your behalf, under your direction | |
172 | and control, on terms that prohibit them from making any copies of | |
173 | your copyrighted material outside their relationship with you. | |
174 | ||
175 | Conveying under any other circumstances is permitted solely under | |
176 | the conditions stated below. Sublicensing is not allowed; section 10 | |
177 | makes it unnecessary. | |
178 | ||
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. | |
180 | ||
181 | No covered work shall be deemed part of an effective technological | |
182 | measure under any applicable law fulfilling obligations under article | |
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or | |
184 | similar laws prohibiting or restricting circumvention of such | |
185 | measures. | |
186 | ||
187 | When you convey a covered work, you waive any legal power to forbid | |
188 | circumvention of technological measures to the extent such circumvention | |
189 | is effected by exercising rights under this License with respect to | |
190 | the covered work, and you disclaim any intention to limit operation or | |
191 | modification of the work as a means of enforcing, against the work's | |
192 | users, your or third parties' legal rights to forbid circumvention of | |
193 | technological measures. | |
194 | ||
195 | 4. Conveying Verbatim Copies. | |
196 | ||
197 | You may convey verbatim copies of the Program's source code as you | |
198 | receive it, in any medium, provided that you conspicuously and | |
199 | appropriately publish on each copy an appropriate copyright notice; | |
200 | keep intact all notices stating that this License and any | |
201 | non-permissive terms added in accord with section 7 apply to the code; | |
202 | keep intact all notices of the absence of any warranty; and give all | |
203 | recipients a copy of this License along with the Program. | |
204 | ||
205 | You may charge any price or no price for each copy that you convey, | |
206 | and you may offer support or warranty protection for a fee. | |
207 | ||
208 | 5. Conveying Modified Source Versions. | |
209 | ||
210 | You may convey a work based on the Program, or the modifications to | |
211 | produce it from the Program, in the form of source code under the | |
212 | terms of section 4, provided that you also meet all of these conditions: | |
213 | ||
214 | a) The work must carry prominent notices stating that you modified | |
215 | it, and giving a relevant date. | |
216 | ||
217 | b) The work must carry prominent notices stating that it is | |
218 | released under this License and any conditions added under section | |
219 | 7. This requirement modifies the requirement in section 4 to | |
220 | "keep intact all notices". | |
221 | ||
222 | c) You must license the entire work, as a whole, under this | |
223 | License to anyone who comes into possession of a copy. This | |
224 | License will therefore apply, along with any applicable section 7 | |
225 | additional terms, to the whole of the work, and all its parts, | |
226 | regardless of how they are packaged. This License gives no | |
227 | permission to license the work in any other way, but it does not | |
228 | invalidate such permission if you have separately received it. | |
229 | ||
230 | d) If the work has interactive user interfaces, each must display | |
231 | Appropriate Legal Notices; however, if the Program has interactive | |
232 | interfaces that do not display Appropriate Legal Notices, your | |
233 | work need not make them do so. | |
234 | ||
235 | A compilation of a covered work with other separate and independent | |
236 | works, which are not by their nature extensions of the covered work, | |
237 | and which are not combined with it such as to form a larger program, | |
238 | in or on a volume of a storage or distribution medium, is called an | |
239 | "aggregate" if the compilation and its resulting copyright are not | |
240 | used to limit the access or legal rights of the compilation's users | |
241 | beyond what the individual works permit. Inclusion of a covered work | |
242 | in an aggregate does not cause this License to apply to the other | |
243 | parts of the aggregate. | |
244 | ||
245 | 6. Conveying Non-Source Forms. | |
246 | ||
247 | You may convey a covered work in object code form under the terms | |
248 | of sections 4 and 5, provided that you also convey the | |
249 | machine-readable Corresponding Source under the terms of this License, | |
250 | in one of these ways: | |
251 | ||
252 | a) Convey the object code in, or embodied in, a physical product | |
253 | (including a physical distribution medium), accompanied by the | |
254 | Corresponding Source fixed on a durable physical medium | |
255 | customarily used for software interchange. | |
256 | ||
257 | b) Convey the object code in, or embodied in, a physical product | |
258 | (including a physical distribution medium), accompanied by a | |
259 | written offer, valid for at least three years and valid for as | |
260 | long as you offer spare parts or customer support for that product | |
261 | model, to give anyone who possesses the object code either (1) a | |
262 | copy of the Corresponding Source for all the software in the | |
263 | product that is covered by this License, on a durable physical | |
264 | medium customarily used for software interchange, for a price no | |
265 | more than your reasonable cost of physically performing this | |
266 | conveying of source, or (2) access to copy the | |
267 | Corresponding Source from a network server at no charge. | |
268 | ||
269 | c) Convey individual copies of the object code with a copy of the | |
270 | written offer to provide the Corresponding Source. This | |
271 | alternative is allowed only occasionally and noncommercially, and | |
272 | only if you received the object code with such an offer, in accord | |
273 | with subsection 6b. | |
274 | ||
275 | d) Convey the object code by offering access from a designated | |
276 | place (gratis or for a charge), and offer equivalent access to the | |
277 | Corresponding Source in the same way through the same place at no | |
278 | further charge. You need not require recipients to copy the | |
279 | Corresponding Source along with the object code. If the place to | |
280 | copy the object code is a network server, the Corresponding Source | |
281 | may be on a different server (operated by you or a third party) | |
282 | that supports equivalent copying facilities, provided you maintain | |
283 | clear directions next to the object code saying where to find the | |
284 | Corresponding Source. Regardless of what server hosts the | |
285 | Corresponding Source, you remain obligated to ensure that it is | |
286 | available for as long as needed to satisfy these requirements. | |
287 | ||
288 | e) Convey the object code using peer-to-peer transmission, provided | |
289 | you inform other peers where the object code and Corresponding | |
290 | Source of the work are being offered to the general public at no | |
291 | charge under subsection 6d. | |
292 | ||
293 | A separable portion of the object code, whose source code is excluded | |
294 | from the Corresponding Source as a System Library, need not be | |
295 | included in conveying the object code work. | |
296 | ||
297 | A "User Product" is either (1) a "consumer product", which means any | |
298 | tangible personal property which is normally used for personal, family, | |
299 | or household purposes, or (2) anything designed or sold for incorporation | |
300 | into a dwelling. In determining whether a product is a consumer product, | |
301 | doubtful cases shall be resolved in favor of coverage. For a particular | |
302 | product received by a particular user, "normally used" refers to a | |
303 | typical or common use of that class of product, regardless of the status | |
304 | of the particular user or of the way in which the particular user | |
305 | actually uses, or expects or is expected to use, the product. A product | |
306 | is a consumer product regardless of whether the product has substantial | |
307 | commercial, industrial or non-consumer uses, unless such uses represent | |
308 | the only significant mode of use of the product. | |
309 | ||
310 | "Installation Information" for a User Product means any methods, | |
311 | procedures, authorization keys, or other information required to install | |
312 | and execute modified versions of a covered work in that User Product from | |
313 | a modified version of its Corresponding Source. The information must | |
314 | suffice to ensure that the continued functioning of the modified object | |
315 | code is in no case prevented or interfered with solely because | |
316 | modification has been made. | |
317 | ||
318 | If you convey an object code work under this section in, or with, or | |
319 | specifically for use in, a User Product, and the conveying occurs as | |
320 | part of a transaction in which the right of possession and use of the | |
321 | User Product is transferred to the recipient in perpetuity or for a | |
322 | fixed term (regardless of how the transaction is characterized), the | |
323 | Corresponding Source conveyed under this section must be accompanied | |
324 | by the Installation Information. But this requirement does not apply | |
325 | if neither you nor any third party retains the ability to install | |
326 | modified object code on the User Product (for example, the work has | |
327 | been installed in ROM). | |
328 | ||
329 | The requirement to provide Installation Information does not include a | |
330 | requirement to continue to provide support service, warranty, or updates | |
331 | for a work that has been modified or installed by the recipient, or for | |
332 | the User Product in which it has been modified or installed. Access to a | |
333 | network may be denied when the modification itself materially and | |
334 | adversely affects the operation of the network or violates the rules and | |
335 | protocols for communication across the network. | |
336 | ||
337 | Corresponding Source conveyed, and Installation Information provided, | |
338 | in accord with this section must be in a format that is publicly | |
339 | documented (and with an implementation available to the public in | |
340 | source code form), and must require no special password or key for | |
341 | unpacking, reading or copying. | |
342 | ||
343 | 7. Additional Terms. | |
344 | ||
345 | "Additional permissions" are terms that supplement the terms of this | |
346 | License by making exceptions from one or more of its conditions. | |
347 | Additional permissions that are applicable to the entire Program shall | |
348 | be treated as though they were included in this License, to the extent | |
349 | that they are valid under applicable law. If additional permissions | |
350 | apply only to part of the Program, that part may be used separately | |
351 | under those permissions, but the entire Program remains governed by | |
352 | this License without regard to the additional permissions. | |
353 | ||
354 | When you convey a copy of a covered work, you may at your option | |
355 | remove any additional permissions from that copy, or from any part of | |
356 | it. (Additional permissions may be written to require their own | |
357 | removal in certain cases when you modify the work.) You may place | |
358 | additional permissions on material, added by you to a covered work, | |
359 | for which you have or can give appropriate copyright permission. | |
360 | ||
361 | Notwithstanding any other provision of this License, for material you | |
362 | add to a covered work, you may (if authorized by the copyright holders of | |
363 | that material) supplement the terms of this License with terms: | |
364 | ||
365 | a) Disclaiming warranty or limiting liability differently from the | |
366 | terms of sections 15 and 16 of this License; or | |
367 | ||
368 | b) Requiring preservation of specified reasonable legal notices or | |
369 | author attributions in that material or in the Appropriate Legal | |
370 | Notices displayed by works containing it; or | |
371 | ||
372 | c) Prohibiting misrepresentation of the origin of that material, or | |
373 | requiring that modified versions of such material be marked in | |
374 | reasonable ways as different from the original version; or | |
375 | ||
376 | d) Limiting the use for publicity purposes of names of licensors or | |
377 | authors of the material; or | |
378 | ||
379 | e) Declining to grant rights under trademark law for use of some | |
380 | trade names, trademarks, or service marks; or | |
381 | ||
382 | f) Requiring indemnification of licensors and authors of that | |
383 | material by anyone who conveys the material (or modified versions of | |
384 | it) with contractual assumptions of liability to the recipient, for | |
385 | any liability that these contractual assumptions directly impose on | |
386 | those licensors and authors. | |
387 | ||
388 | All other non-permissive additional terms are considered "further | |
389 | restrictions" within the meaning of section 10. If the Program as you | |
390 | received it, or any part of it, contains a notice stating that it is | |
391 | governed by this License along with a term that is a further | |
392 | restriction, you may remove that term. If a license document contains | |
393 | a further restriction but permits relicensing or conveying under this | |
394 | License, you may add to a covered work material governed by the terms | |
395 | of that license document, provided that the further restriction does | |
396 | not survive such relicensing or conveying. | |
397 | ||
398 | If you add terms to a covered work in accord with this section, you | |
399 | must place, in the relevant source files, a statement of the | |
400 | additional terms that apply to those files, or a notice indicating | |
401 | where to find the applicable terms. | |
402 | ||
403 | Additional terms, permissive or non-permissive, may be stated in the | |
404 | form of a separately written license, or stated as exceptions; | |
405 | the above requirements apply either way. | |
406 | ||
407 | 8. Termination. | |
408 | ||
409 | You may not propagate or modify a covered work except as expressly | |
410 | provided under this License. Any attempt otherwise to propagate or | |
411 | modify it is void, and will automatically terminate your rights under | |
412 | this License (including any patent licenses granted under the third | |
413 | paragraph of section 11). | |
414 | ||
415 | However, if you cease all violation of this License, then your | |
416 | license from a particular copyright holder is reinstated (a) | |
417 | provisionally, unless and until the copyright holder explicitly and | |
418 | finally terminates your license, and (b) permanently, if the copyright | |
419 | holder fails to notify you of the violation by some reasonable means | |
420 | prior to 60 days after the cessation. | |
421 | ||
422 | Moreover, your license from a particular copyright holder is | |
423 | reinstated permanently if the copyright holder notifies you of the | |
424 | violation by some reasonable means, this is the first time you have | |
425 | received notice of violation of this License (for any work) from that | |
426 | copyright holder, and you cure the violation prior to 30 days after | |
427 | your receipt of the notice. | |
428 | ||
429 | Termination of your rights under this section does not terminate the | |
430 | licenses of parties who have received copies or rights from you under | |
431 | this License. If your rights have been terminated and not permanently | |
432 | reinstated, you do not qualify to receive new licenses for the same | |
433 | material under section 10. | |
434 | ||
435 | 9. Acceptance Not Required for Having Copies. | |
436 | ||
437 | You are not required to accept this License in order to receive or | |
438 | run a copy of the Program. Ancillary propagation of a covered work | |
439 | occurring solely as a consequence of using peer-to-peer transmission | |
440 | to receive a copy likewise does not require acceptance. However, | |
441 | nothing other than this License grants you permission to propagate or | |
442 | modify any covered work. These actions infringe copyright if you do | |
443 | not accept this License. Therefore, by modifying or propagating a | |
444 | covered work, you indicate your acceptance of this License to do so. | |
445 | ||
446 | 10. Automatic Licensing of Downstream Recipients. | |
447 | ||
448 | Each time you convey a covered work, the recipient automatically | |
449 | receives a license from the original licensors, to run, modify and | |
450 | propagate that work, subject to this License. You are not responsible | |
451 | for enforcing compliance by third parties with this License. | |
452 | ||
453 | An "entity transaction" is a transaction transferring control of an | |
454 | organization, or substantially all assets of one, or subdividing an | |
455 | organization, or merging organizations. If propagation of a covered | |
456 | work results from an entity transaction, each party to that | |
457 | transaction who receives a copy of the work also receives whatever | |
458 | licenses to the work the party's predecessor in interest had or could | |
459 | give under the previous paragraph, plus a right to possession of the | |
460 | Corresponding Source of the work from the predecessor in interest, if | |
461 | the predecessor has it or can get it with reasonable efforts. | |
462 | ||
463 | You may not impose any further restrictions on the exercise of the | |
464 | rights granted or affirmed under this License. For example, you may | |
465 | not impose a license fee, royalty, or other charge for exercise of | |
466 | rights granted under this License, and you may not initiate litigation | |
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that | |
468 | any patent claim is infringed by making, using, selling, offering for | |
469 | sale, or importing the Program or any portion of it. | |
470 | ||
471 | 11. Patents. | |
472 | ||
473 | A "contributor" is a copyright holder who authorizes use under this | |
474 | License of the Program or a work on which the Program is based. The | |
475 | work thus licensed is called the contributor's "contributor version". | |
476 | ||
477 | A contributor's "essential patent claims" are all patent claims | |
478 | owned or controlled by the contributor, whether already acquired or | |
479 | hereafter acquired, that would be infringed by some manner, permitted | |
480 | by this License, of making, using, or selling its contributor version, | |
481 | but do not include claims that would be infringed only as a | |
482 | consequence of further modification of the contributor version. For | |
483 | purposes of this definition, "control" includes the right to grant | |
484 | patent sublicenses in a manner consistent with the requirements of | |
485 | this License. | |
486 | ||
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free | |
488 | patent license under the contributor's essential patent claims, to | |
489 | make, use, sell, offer for sale, import and otherwise run, modify and | |
490 | propagate the contents of its contributor version. | |
491 | ||
492 | In the following three paragraphs, a "patent license" is any express | |
493 | agreement or commitment, however denominated, not to enforce a patent | |
494 | (such as an express permission to practice a patent or covenant not to | |
495 | sue for patent infringement). To "grant" such a patent license to a | |
496 | party means to make such an agreement or commitment not to enforce a | |
497 | patent against the party. | |
498 | ||
499 | If you convey a covered work, knowingly relying on a patent license, | |
500 | and the Corresponding Source of the work is not available for anyone | |
501 | to copy, free of charge and under the terms of this License, through a | |
502 | publicly available network server or other readily accessible means, | |
503 | then you must either (1) cause the Corresponding Source to be so | |
504 | available, or (2) arrange to deprive yourself of the benefit of the | |
505 | patent license for this particular work, or (3) arrange, in a manner | |
506 | consistent with the requirements of this License, to extend the patent | |
507 | license to downstream recipients. "Knowingly relying" means you have | |
508 | actual knowledge that, but for the patent license, your conveying the | |
509 | covered work in a country, or your recipient's use of the covered work | |
510 | in a country, would infringe one or more identifiable patents in that | |
511 | country that you have reason to believe are valid. | |
512 | ||
513 | If, pursuant to or in connection with a single transaction or | |
514 | arrangement, you convey, or propagate by procuring conveyance of, a | |
515 | covered work, and grant a patent license to some of the parties | |
516 | receiving the covered work authorizing them to use, propagate, modify | |
517 | or convey a specific copy of the covered work, then the patent license | |
518 | you grant is automatically extended to all recipients of the covered | |
519 | work and works based on it. | |
520 | ||
521 | A patent license is "discriminatory" if it does not include within | |
522 | the scope of its coverage, prohibits the exercise of, or is | |
523 | conditioned on the non-exercise of one or more of the rights that are | |
524 | specifically granted under this License. You may not convey a covered | |
525 | work if you are a party to an arrangement with a third party that is | |
526 | in the business of distributing software, under which you make payment | |
527 | to the third party based on the extent of your activity of conveying | |
528 | the work, and under which the third party grants, to any of the | |
529 | parties who would receive the covered work from you, a discriminatory | |
530 | patent license (a) in connection with copies of the covered work | |
531 | conveyed by you (or copies made from those copies), or (b) primarily | |
532 | for and in connection with specific products or compilations that | |
533 | contain the covered work, unless you entered into that arrangement, | |
534 | or that patent license was granted, prior to 28 March 2007. | |
535 | ||
536 | Nothing in this License shall be construed as excluding or limiting | |
537 | any implied license or other defenses to infringement that may | |
538 | otherwise be available to you under applicable patent law. | |
539 | ||
540 | 12. No Surrender of Others' Freedom. | |
541 | ||
542 | If conditions are imposed on you (whether by court order, agreement or | |
543 | otherwise) that contradict the conditions of this License, they do not | |
544 | excuse you from the conditions of this License. If you cannot convey a | |
545 | covered work so as to satisfy simultaneously your obligations under this | |
546 | License and any other pertinent obligations, then as a consequence you may | |
547 | not convey it at all. For example, if you agree to terms that obligate you | |
548 | to collect a royalty for further conveying from those to whom you convey | |
549 | the Program, the only way you could satisfy both those terms and this | |
550 | License would be to refrain entirely from conveying the Program. | |
551 | ||
552 | 13. Use with the GNU Affero General Public License. | |
553 | ||
554 | Notwithstanding any other provision of this License, you have | |
555 | permission to link or combine any covered work with a work licensed | |
556 | under version 3 of the GNU Affero General Public License into a single | |
557 | combined work, and to convey the resulting work. The terms of this | |
558 | License will continue to apply to the part which is the covered work, | |
559 | but the special requirements of the GNU Affero General Public License, | |
560 | section 13, concerning interaction through a network will apply to the | |
561 | combination as such. | |
562 | ||
563 | 14. Revised Versions of this License. | |
564 | ||
565 | The Free Software Foundation may publish revised and/or new versions of | |
566 | the GNU General Public License from time to time. Such new versions will | |
567 | be similar in spirit to the present version, but may differ in detail to | |
568 | address new problems or concerns. | |
569 | ||
570 | Each version is given a distinguishing version number. If the | |
571 | Program specifies that a certain numbered version of the GNU General | |
572 | Public License "or any later version" applies to it, you have the | |
573 | option of following the terms and conditions either of that numbered | |
574 | version or of any later version published by the Free Software | |
575 | Foundation. If the Program does not specify a version number of the | |
576 | GNU General Public License, you may choose any version ever published | |
577 | by the Free Software Foundation. | |
578 | ||
579 | If the Program specifies that a proxy can decide which future | |
580 | versions of the GNU General Public License can be used, that proxy's | |
581 | public statement of acceptance of a version permanently authorizes you | |
582 | to choose that version for the Program. | |
583 | ||
584 | Later license versions may give you additional or different | |
585 | permissions. However, no additional obligations are imposed on any | |
586 | author or copyright holder as a result of your choosing to follow a | |
587 | later version. | |
588 | ||
589 | 15. Disclaimer of Warranty. | |
590 | ||
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | |
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | |
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY | |
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, | |
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM | |
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF | |
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |
599 | ||
600 | 16. Limitation of Liability. | |
601 | ||
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS | |
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY | |
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE | |
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF | |
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD | |
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), | |
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | |
610 | SUCH DAMAGES. | |
611 | ||
612 | 17. Interpretation of Sections 15 and 16. | |
613 | ||
614 | If the disclaimer of warranty and limitation of liability provided | |
615 | above cannot be given local legal effect according to their terms, | |
616 | reviewing courts shall apply local law that most closely approximates | |
617 | an absolute waiver of all civil liability in connection with the | |
618 | Program, unless a warranty or assumption of liability accompanies a | |
619 | copy of the Program in return for a fee. | |
620 | ||
621 | END OF TERMS AND CONDITIONS | |
622 | ||
623 | How to Apply These Terms to Your New Programs | |
624 | ||
625 | If you develop a new program, and you want it to be of the greatest | |
626 | possible use to the public, the best way to achieve this is to make it | |
627 | free software which everyone can redistribute and change under these terms. | |
628 | ||
629 | To do so, attach the following notices to the program. It is safest | |
630 | to attach them to the start of each source file to most effectively | |
631 | state the exclusion of warranty; and each file should have at least | |
632 | the "copyright" line and a pointer to where the full notice is found. | |
633 | ||
634 | <one line to give the program's name and a brief idea of what it does.> | |
635 | Copyright (C) <year> <name of author> | |
636 | ||
637 | This program is free software: you can redistribute it and/or modify | |
638 | it under the terms of the GNU General Public License as published by | |
639 | the Free Software Foundation, either version 3 of the License, or | |
640 | (at your option) any later version. | |
641 | ||
642 | This program is distributed in the hope that it will be useful, | |
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
645 | GNU General Public License for more details. | |
646 | ||
647 | You should have received a copy of the GNU General Public License | |
648 | along with this program. If not, see <http://www.gnu.org/licenses/>. | |
649 | ||
650 | Also add information on how to contact you by electronic and paper mail. | |
651 | ||
652 | If the program does terminal interaction, make it output a short | |
653 | notice like this when it starts in an interactive mode: | |
654 | ||
655 | <program> Copyright (C) <year> <name of author> | |
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
657 | This is free software, and you are welcome to redistribute it | |
658 | under certain conditions; type `show c' for details. | |
659 | ||
660 | The hypothetical commands `show w' and `show c' should show the appropriate | |
661 | parts of the General Public License. Of course, your program's commands | |
662 | might be different; for a GUI interface, you would use an "about box". | |
663 | ||
664 | You should also get your employer (if you work as a programmer) or school, | |
665 | if any, to sign a "copyright disclaimer" for the program, if necessary. | |
666 | For more information on this, and how to apply and follow the GNU GPL, see | |
667 | <http://www.gnu.org/licenses/>. | |
668 | ||
669 | The GNU General Public License does not permit incorporating your program | |
670 | into proprietary programs. If your program is a subroutine library, you | |
671 | may consider it more useful to permit linking proprietary applications with | |
672 | the library. If this is what you want to do, use the GNU Lesser General | |
673 | Public License instead of this License. But first, please read | |
674 | <http://www.gnu.org/philosophy/why-not-lgpl.html>. | |
675 |
0 | # -*- coding: utf-8 -*- | |
1 | ||
2 | class Debug: | |
3 | def __init__(self, debugLevel): | |
4 | self.debugLevel=debugLevel | |
5 | ||
6 | def __call__(self,level,msg): | |
7 | if self.debugLevel > level: | |
8 | print(msg) |
0 | # -*- coding: utf-8 -*- | |
1 | ||
2 | def traduit(chaine): | |
3 | """cette méthode vérifie la validité de la chaîne en fonction de sa provenance et, au besoin, transforme des expressions possibles (10^11) en grandeur acceptée par python""" | |
4 | # on force le type chaîne pour pouvoir faire des évaluations. | |
5 | chaine=str(chaine).replace(" ","") # et retrait de tous les espaces | |
6 | ||
7 | #vérification de la présence d'un float correct, sinon tente des modifs. | |
8 | try : | |
9 | chaine=float(eval(chaine)) | |
10 | except : | |
11 | chaine=chaine.replace("10^","e") | |
12 | #remplace la chaine 10^ par e | |
13 | else: | |
14 | return chaine | |
15 | ||
16 | try : | |
17 | chaine=float(eval(chaine)) | |
18 | except : | |
19 | #remplace les "x" pour la multiplication | |
20 | chaine=chaine.replace("x","*") | |
21 | chaine=chaine.replace("X","*") | |
22 | else: | |
23 | return chaine | |
24 | ||
25 | try : | |
26 | chaine=float(eval(chaine)) | |
27 | except : | |
28 | #remplace les "*" devant un "e" | |
29 | chaine=chaine.replace("*e","e") | |
30 | else: | |
31 | return chaine | |
32 | ||
33 | try : | |
34 | chaine=float(eval(chaine)) | |
35 | except : | |
36 | #self.debug(0,u"Erreur : %s, même après les tranformations, n'est pas une expression acceptable" %chaine) | |
37 | return 1.0 | |
38 | else: | |
39 | return chaine | |
40 | return 1.0 | |
41 |
0 | <ui version="4.0" > | |
1 | <class>Graphe</class> | |
2 | <widget class="QDialog" name="Graphe" > | |
3 | <property name="geometry" > | |
4 | <rect> | |
5 | <x>0</x> | |
6 | <y>0</y> | |
7 | <width>302</width> | |
8 | <height>516</height> | |
9 | </rect> | |
10 | </property> | |
11 | <property name="windowTitle" > | |
12 | <string>Dialog</string> | |
13 | </property> | |
14 | <widget class="QDialogButtonBox" name="buttonBox" > | |
15 | <property name="geometry" > | |
16 | <rect> | |
17 | <x>110</x> | |
18 | <y>480</y> | |
19 | <width>81</width> | |
20 | <height>32</height> | |
21 | </rect> | |
22 | </property> | |
23 | <property name="orientation" > | |
24 | <enum>Qt::Horizontal</enum> | |
25 | </property> | |
26 | <property name="standardButtons" > | |
27 | <set>QDialogButtonBox::Close</set> | |
28 | </property> | |
29 | </widget> | |
30 | <widget class="QLabel" name="grapheLabel" > | |
31 | <property name="geometry" > | |
32 | <rect> | |
33 | <x>10</x> | |
34 | <y>10</y> | |
35 | <width>270</width> | |
36 | <height>450</height> | |
37 | </rect> | |
38 | </property> | |
39 | <property name="text" > | |
40 | <string/> | |
41 | </property> | |
42 | </widget> | |
43 | </widget> | |
44 | <resources/> | |
45 | <connections> | |
46 | <connection> | |
47 | <sender>buttonBox</sender> | |
48 | <signal>accepted()</signal> | |
49 | <receiver>Graphe</receiver> | |
50 | <slot>accept()</slot> | |
51 | <hints> | |
52 | <hint type="sourcelabel" > | |
53 | <x>248</x> | |
54 | <y>254</y> | |
55 | </hint> | |
56 | <hint type="destinationlabel" > | |
57 | <x>157</x> | |
58 | <y>274</y> | |
59 | </hint> | |
60 | </hints> | |
61 | </connection> | |
62 | <connection> | |
63 | <sender>buttonBox</sender> | |
64 | <signal>rejected()</signal> | |
65 | <receiver>Graphe</receiver> | |
66 | <slot>reject()</slot> | |
67 | <hints> | |
68 | <hint type="sourcelabel" > | |
69 | <x>316</x> | |
70 | <y>260</y> | |
71 | </hint> | |
72 | <hint type="destinationlabel" > | |
73 | <x>286</x> | |
74 | <y>274</y> | |
75 | </hint> | |
76 | </hints> | |
77 | </connection> | |
78 | </connections> | |
79 | </ui> |
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
0 | Le logiciel pysatellites permet de simuler le lancement d'un satellite | |
1 | autour de nombreux astres connus. C'est un logiciel libre, diffusé sous | |
2 | la licence GPL version 3. Voyez les fichiers COPYING Changelog et AUTHORS | |
3 | ||
4 | Pour être pleinement fonctionnel, il est préférable d'installer en même | |
5 | temps les logiciels libres xplanet et la base de données du logiciel celestia | |
6 | ;) de toute façon, une personne intéressée par pysatellites sera très | |
7 | probablement aussi intéressée par xplanet et celestia, pour de nombreux | |
8 | usages complémentaires. | |
9 | ||
10 | Certaines formules sont utilisées pour faciliter la simulation : | |
11 | - la méthode d'intégration de Runge-Kutta qui est d'ordre 4, beaucoup | |
12 | pkus efficace que al méthode d'Euler | |
13 | - un calcul des paramètres de la trajectoire à partir des données connues | |
14 | dès le lancement : énergie mécanique, grand axe, excentricité, période, | |
15 | etc. | |
16 | ||
17 | Le fondement théorique des méthodes emplyées est décrit dans le fichier | |
18 | methodes.tm, qui s'ouvre à l'aide du logiciel libre TexMacs. |
0 | #-*- coding: utf-8 -*- | |
1 | ||
2 | """ | |
3 | code pour la fenêtre principale de pysatellites | |
4 | """ | |
5 | ||
6 | licence=""" | |
7 | the file mainWindow.py is part of the package pysatellites. | |
8 | ||
9 | Copyright (C) 2007-2008 Jean-Baptiste Butet <ashashiwa@gmail.com>, | |
10 | (C) 2007-2008 Georges Khaznadar <georgesk@ofset.org> | |
11 | ||
12 | ||
13 | This program is free software: you can redistribute it and/or modify | |
14 | it under the terms of the GNU General Public License as published by | |
15 | the Free Software Foundation, either version 3 of the License, or | |
16 | (at your option) any later version. | |
17 | ||
18 | This program is distributed in the hope that it will be useful, | |
19 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 | GNU General Public License for more details. | |
22 | ||
23 | You should have received a copy of the GNU General Public License | |
24 | along with this program. If not, see <http://www.gnu.org/licenses/>. | |
25 | """ | |
26 | ||
27 | import sys, os | |
28 | from PyQt4.QtCore import * | |
29 | from PyQt4.QtGui import * | |
30 | from glob import glob | |
31 | from UI_pysat import Ui_MainWindow | |
32 | from traj_satellite import Trajectoire | |
33 | from math import pi, cos, sin, fabs | |
34 | from astres import astreNom | |
35 | from point import Point | |
36 | from matplotlib_widget import MyMplCanvas | |
37 | from repertoire import repertoire | |
38 | from video import Cinema | |
39 | import flottant as flottant | |
40 | from debug import Debug | |
41 | ||
42 | class StartQT4(QMainWindow): | |
43 | def __init__(self, parent, rep=None , debugger=Debug(1), app=None): | |
44 | QMainWindow.__init__(self) | |
45 | QWidget.__init__(self, parent) | |
46 | self.debug=debugger | |
47 | self.app=app | |
48 | self.ui = Ui_MainWindow() | |
49 | self.ui.setupUi(self) | |
50 | if rep == None: | |
51 | self.rep=repertoire(sys.argv[0]) | |
52 | else: | |
53 | self.rep=rep | |
54 | self.trajectoire = Trajectoire(self.ui.afficheur, 6400, self, debugger=self.debug) | |
55 | self.initAstres() | |
56 | self.ui.masse_astre.setText(QApplication.translate("MainWindow", "6x10^24", None, QApplication.UnicodeUTF8)) | |
57 | self.ui.rayon_astre.setText(QApplication.translate("MainWindow", "6400", None, QApplication.UnicodeUTF8)) | |
58 | os.chdir(self.rep.chemin("defaut")) | |
59 | self.image_sat=QPixmap("icones/sat_mini.gif") | |
60 | self.connexions_signaux() | |
61 | self.placeDepart() | |
62 | self.cinemaThread=None | |
63 | self.progress=None | |
64 | ||
65 | ||
66 | def getRayonAstre(self): | |
67 | return flottant.traduit(self.ui.rayon_astre.text())*1000 | |
68 | ||
69 | def placeDepart(self): | |
70 | """ | |
71 | place la croix à la position de départ du satellite et figure | |
72 | le vecteur vitesse | |
73 | """ | |
74 | self.trajectoire.efface() | |
75 | x=0 | |
76 | y=(flottant.traduit(self.ui.rayon_astre.text())+flottant.traduit(self.ui.altitude_objet.text()))*1000 | |
77 | self.trajectoire.setEchelle(y,"max") | |
78 | vx=flottant.traduit(self.ui.vitesse_tangentielle_objet.text()) | |
79 | vy=flottant.traduit(self.ui.vitesse_normale_objet.text()) | |
80 | ||
81 | self.trajectoire.dessine([(x,y,0,vx,vy,0)]) | |
82 | self.trajectoire.update() | |
83 | ||
84 | def initAstres(self): | |
85 | """ | |
86 | Peuple le combo avec les noms d'astres | |
87 | """ | |
88 | for a in astreNom: | |
89 | self.ui.astreCombo.addItem(QApplication.translate("MainWindow", a[0], None, QApplication.UnicodeUTF8)) | |
90 | self.ui.astreCombo.setEditable(False) | |
91 | self.ui.astreCombo.setCurrentIndex(0) | |
92 | self.astreCourant="earth" | |
93 | self.choisi_astre(0) | |
94 | ||
95 | def connexions_signaux(self): | |
96 | QObject.connect(self.ui.Bouton_Lancer,SIGNAL("clicked()"), self.trajectoire.lance) | |
97 | QObject.connect(self.ui.Button_efface,SIGNAL("clicked()"), self.efface_trajectoire) | |
98 | QObject.connect(self.ui.bouton_video,SIGNAL("clicked()"), self.cinema) | |
99 | QObject.connect(self.ui.altitude_objet,SIGNAL("editingFinished()"), self.placeDepart) | |
100 | QObject.connect(self.ui.astreCombo,SIGNAL("currentIndexChanged(int)"),self.choisi_astre) | |
101 | QObject.connect(self.ui.radioButton_Frenet,SIGNAL("toggled(bool)"), self.choisi_coordoonees) | |
102 | #QObject.connect(self.ui.checkBox_efface,SIGNAL("stateChanged(bool)"), self.change_comportement_effacege) | |
103 | timer = QTimer(self); | |
104 | QObject.connect(timer, SIGNAL("timeout()"), self.routines); | |
105 | timer.start(1000); | |
106 | ||
107 | ||
108 | self.ui.mTerre.setReadOnly (True) | |
109 | self.ui.rTerre.setReadOnly (True) | |
110 | self.ui.auSujetAstre.setReadOnly (True) | |
111 | ||
112 | def change_comportement_effacege(self,int): | |
113 | pass | |
114 | ||
115 | def efface_trajectoire(self): | |
116 | self.trajectoire.efface() | |
117 | self.placeDepart() | |
118 | ||
119 | def cinema(self): | |
120 | if self.cinemaThread!=None and self.cinemaThread.isAlive(): | |
121 | return | |
122 | import datetime,copy | |
123 | from numpy import arange | |
124 | date=datetime.datetime(2008,4,25) | |
125 | date=date.today() | |
126 | if self.trajectoire.traj != None: | |
127 | liste_temps=arange(0,self.trajectoire.t,self.trajectoire.dt) | |
128 | pas=10 # une image pour 10 calculs numériques | |
129 | titre=QApplication.translate("MainWindow", "Calcul de la vidéo", None, QApplication.UnicodeUTF8) | |
130 | legende=QApplication.translate("MainWindow", "Avancement ...", None, QApplication.UnicodeUTF8) | |
131 | echap=QApplication.translate("MainWindow", "Arrêt", None, QApplication.UnicodeUTF8) | |
132 | self.progress=QProgressDialog(legende,echap,0,len(liste_temps)/pas) | |
133 | self.progress.setWindowTitle(titre) | |
134 | self.progress.setValue(0) | |
135 | self.progress.show() | |
136 | ||
137 | # on lance le thread avec une copie de la liste calculée | |
138 | self.cinemaThread=Cinema(self.rep, self.astreCourant, date, | |
139 | liste_temps, | |
140 | copy.copy(self.trajectoire.traj.pv), | |
141 | "380x240", | |
142 | pas=pas, boum=self.trajectoire.boum, | |
143 | debugger=self.debug) | |
144 | self.cinemaThread.start() | |
145 | ||
146 | def routines(self): | |
147 | if self.cinemaThread!=None and self.cinemaThread.isAlive(): | |
148 | self.progress.setValue(self.cinemaThread.nbImage) | |
149 | if self.progress.wasCanceled(): | |
150 | self.progress.close() | |
151 | self.cinemaThread.fini=True | |
152 | if self.cinemaThread.fini: | |
153 | self.progress.setValue(self.progress.maximum()+1) | |
154 | if self.progress: self.progress.close() | |
155 | ||
156 | ||
157 | def getMasseAstre(self): | |
158 | return flottant.traduit(self.ui.masse_astre.text()) | |
159 | def getDistanceAstre(self): | |
160 | return (flottant.traduit(self.ui.rayon_astre.text()) + flottant.traduit(self.ui.altitude_objet.text()))*1000 #passe en mètres | |
161 | def getVitesse(self): | |
162 | return (flottant.traduit(self.ui.vitesse_tangentielle_objet.text()), | |
163 | flottant.traduit(self.ui.vitesse_normale_objet.text())) | |
164 | ||
165 | ||
166 | def choisi_coordoonees(self,bool): | |
167 | if self.ui.radioButton_Cartesiennes.isChecked()==True : | |
168 | self.ui.label_V1.setText(QApplication.translate("MainWindow", "Vitesse selon Ox", None, QApplication.UnicodeUTF8)) | |
169 | self.ui.label_V2.setText(QApplication.translate("MainWindow", "Vitesse selon Oy", None, QApplication.UnicodeUTF8)) | |
170 | ||
171 | elif self.ui.radioButton_Cartesiennes.isChecked()==False : | |
172 | self.ui.label_V1.setText(QApplication.translate("MainWindow", "Vitesse Tangentielle", None, QApplication.UnicodeUTF8)) | |
173 | self.ui.label_V2.setText(QApplication.translate("MainWindow", "Vitesse Normale", None, QApplication.UnicodeUTF8)) | |
174 | ||
175 | ||
176 | def choisi_astre(self,int): | |
177 | """ | |
178 | choisit un astre parmi la liste disponible, sur la base du texte | |
179 | couramment sélectionné dans le combo | |
180 | @param int non utiliséé | |
181 | """ | |
182 | mt0=astreNom[0][2] | |
183 | rt0=astreNom[0][3] | |
184 | astre=self.ui.astreCombo.currentText() | |
185 | for a in astreNom: | |
186 | if a[0]==astre: | |
187 | self.trajectoire.choisi_astre(a[1]) | |
188 | self.astreCourant=a[1] | |
189 | masse_astre=a[2] | |
190 | rayon_astre=a[3] | |
191 | self.ui.masse_astre.setText(QApplication.translate("MainWindow", masse_astre, None, QApplication.UnicodeUTF8)) | |
192 | self.ui.rayon_astre.setText(QApplication.translate("MainWindow", rayon_astre, None, QApplication.UnicodeUTF8)) | |
193 | mt=flottant.traduit(masse_astre)/flottant.traduit(mt0) | |
194 | rt=flottant.traduit(rayon_astre)/flottant.traduit(rt0) | |
195 | mt="%5g" %mt | |
196 | rt="%5g" %rt | |
197 | self.ui.mTerre.setText(QApplication.translate("MainWindow", mt, None, QApplication.UnicodeUTF8)) | |
198 | self.ui.rTerre.setText(QApplication.translate("MainWindow", rt, None, QApplication.UnicodeUTF8)) | |
199 | self.ui.auSujetAstre.setText(QApplication.translate("MainWindow", a[4], None, QApplication.UnicodeUTF8)) | |
200 | self.placeDepart() | |
201 | self.trajectoire.update() | |
202 | return | |
203 | self.debug(0,"Astre inconnu : %s" %astre) |
0 | <?xml version='1.0' encoding='ISO-8859-1'?> | |
1 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" | |
2 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ | |
3 | ||
4 | <!-- | |
5 | ||
6 | Process this file with an XSLT processor: `xsltproc \ | |
7 | -''-nonet /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\ | |
8 | manpages/docbook.xsl manpage.dbk'. A manual page | |
9 | <package>.<section> will be generated. You may view the | |
10 | manual page with: nroff -man <package>.<section> | less'. A | |
11 | typical entry in a Makefile or Makefile.am is: | |
12 | ||
13 | DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\ | |
14 | manpages/docbook.xsl | |
15 | XP=xsltproc -''-nonet | |
16 | ||
17 | manpage.1: manpage.dbk | |
18 | $(XP) $(DB2MAN) $< | |
19 | ||
20 | The xsltproc binary is found in the xsltproc package. The | |
21 | XSL files are in docbook-xsl. Please remember that if you | |
22 | create the nroff version in one of the debian/rules file | |
23 | targets (such as build), you will need to include xsltproc | |
24 | and docbook-xsl in your Build-Depends control field. | |
25 | ||
26 | --> | |
27 | ||
28 | <!-- Fill in your name for FIRSTNAME and SURNAME. --> | |
29 | <!ENTITY dhfirstname "<firstname>Georges</firstname>"> | |
30 | <!ENTITY dhsurname "<surname>Khaznadar</surname>"> | |
31 | <!-- Please adjust the date whenever revising the manpage. --> | |
32 | <!ENTITY dhdate "<date>mai 14, 2008</date>"> | |
33 | <!-- SECTION should be 1-8, maybe w/ subsection other parameters are | |
34 | allowed: see man(7), man(1). --> | |
35 | <!ENTITY dhsection "<manvolnum>1</manvolnum>"> | |
36 | <!ENTITY dhemail "<email>georgesk@ofset.org</email>"> | |
37 | <!ENTITY dhusername "Georges Khaznadar"> | |
38 | <!ENTITY dhucpackage "<refentrytitle>PYSATELLITES</refentrytitle>"> | |
39 | <!ENTITY dhpackage "pysatellites"> | |
40 | ||
41 | <!ENTITY debian "<productname>Debian</productname>"> | |
42 | <!ENTITY gnu "<acronym>GNU</acronym>"> | |
43 | <!ENTITY gpl "&gnu; <acronym>GPL</acronym>"> | |
44 | ]> | |
45 | ||
46 | <refentry> | |
47 | <refentryinfo> | |
48 | <address> | |
49 | &dhemail; | |
50 | </address> | |
51 | <copyright> | |
52 | <year>2008</year> | |
53 | <holder>&dhusername;</holder> | |
54 | </copyright> | |
55 | &dhdate; | |
56 | </refentryinfo> | |
57 | <refmeta> | |
58 | &dhucpackage; | |
59 | ||
60 | &dhsection; | |
61 | </refmeta> | |
62 | <refnamediv> | |
63 | <refname>&dhpackage;</refname> | |
64 | ||
65 | <refpurpose>simulates the launching of satellites</refpurpose> | |
66 | </refnamediv> | |
67 | <refsynopsisdiv> | |
68 | <cmdsynopsis> | |
69 | <command>&dhpackage;</command> | |
70 | ||
71 | <arg><option>-d <replaceable>debuglevel</replaceable></option></arg> | |
72 | <arg><option>--debug=<replaceable>debuglevel</replaceable></option></arg> | |
73 | <arg><option>-f <replaceable>file</replaceable></option></arg> | |
74 | <arg><option>--fichier=<replaceable>file</replaceable></option></arg> | |
75 | <arg><option>-h </option></arg> | |
76 | <arg><option>--help</option></arg> | |
77 | </cmdsynopsis> | |
78 | </refsynopsisdiv> | |
79 | <refsect1> | |
80 | <title>DESCRIPTION</title> | |
81 | ||
82 | <para> This program can be used to train people to spatial mechanics at an | |
83 | elementary level. You are given the power to launch a satellite, from | |
84 | outside the atmosphere, around a handfull of predefined planets, or around | |
85 | any special object you may imagine. Input the intial velocity vector of the | |
86 | satellite, and you will get the simulated trajectory, as well as some | |
87 | informations like the plots of variation of speed. As an extra, you can | |
88 | compute a movie, which represents the planet seen from the satellite's | |
89 | point of view during its orbital period. | |
90 | </para> | |
91 | ||
92 | </refsect1> | |
93 | <refsect1> | |
94 | <title>OPTIONS</title> | |
95 | ||
96 | <variablelist> | |
97 | <varlistentry> | |
98 | <term><option>-h</option> | |
99 | <option>--help</option> | |
100 | </term> | |
101 | <listitem> | |
102 | <para>Show a short usage description.</para> | |
103 | </listitem> | |
104 | </varlistentry> | |
105 | <varlistentry> | |
106 | <term><option>-d <replaceable>debuglevel</replaceable></option> | |
107 | <option>--debug=<replaceable>debuglevel</replaceable></option> | |
108 | </term> | |
109 | <listitem> | |
110 | <para>Sets the debug level, from 0 to 10 (default = 0).</para> | |
111 | </listitem> | |
112 | </varlistentry> | |
113 | <varlistentry> | |
114 | <term><option>-f <replaceable>file</replaceable></option> | |
115 | <option>--fichier=<replaceable>file</replaceable></option> | |
116 | </term> | |
117 | <listitem> | |
118 | <para>Sets the configuration file (default: none)</para> | |
119 | </listitem> | |
120 | </varlistentry> | |
121 | </variablelist> | |
122 | </refsect1> | |
123 | </refentry> | |
124 |
0 | # embedding_in_qt4.py --- Simple Qt4 application embedding matplotlib canvases | |
1 | # | |
2 | # Copyright (C) 2005 Florent Rougon | |
3 | # 2006 Darren Dale | |
4 | # | |
5 | # This file is an example program for matplotlib. It may be used and | |
6 | # modified with no restriction; raw copies as well as modified versions | |
7 | # may be distributed without limitation. | |
8 | ||
9 | import sys, os, random | |
10 | from PyQt4 import QtGui, QtCore | |
11 | from numpy import arange, sin, pi | |
12 | from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas | |
13 | from matplotlib.figure import Figure | |
14 | from PyQt4.QtCore import * | |
15 | from PyQt4.QtGui import * | |
16 | from UI_graphe import Ui_Graphe | |
17 | ||
18 | progname = os.path.basename(sys.argv[0]) | |
19 | progversion = "0.1" | |
20 | ||
21 | ||
22 | class MyMplCanvas(FigureCanvas): | |
23 | """Ultimately, this is a QWidget (as well as a FigureCanvasAgg, etc.).""" | |
24 | def __init__(self, parent, donnees, traitement, dates, width=0, height=0, dpi=100, cliquable=False, titre=""): | |
25 | self.fig = Figure(figsize=(width, height), dpi=dpi ) | |
26 | FigureCanvas.__init__(self, self.fig) | |
27 | self.setParent(parent) | |
28 | FigureCanvas.setSizePolicy(self, | |
29 | QtGui.QSizePolicy.Expanding, | |
30 | QtGui.QSizePolicy.Expanding) | |
31 | FigureCanvas.updateGeometry(self) | |
32 | self.axes = self.fig.add_subplot(111) | |
33 | a = self.axes.set_axis_off() | |
34 | # We want the axes cleared every time plot() is called | |
35 | self.axes.axison = False | |
36 | self.axes.axis('off') | |
37 | self.axes.hold(False) | |
38 | ||
39 | self.cliquable=cliquable | |
40 | self.donnees=donnees | |
41 | self.traitement=traitement | |
42 | self.dates=dates | |
43 | self.titre=titre | |
44 | ||
45 | self.plot(donnees, traitement, dates) | |
46 | ||
47 | ||
48 | def mouseReleaseEvent(self, event): | |
49 | if self.cliquable: | |
50 | self.fils=QDialog() | |
51 | self.fils.ui=Ui_Graphe() | |
52 | self.fils.ui.setupUi(self.fils) | |
53 | self.fils.setWindowTitle(QtGui.QApplication.translate("Graphe", self.titre, None, QtGui.QApplication.UnicodeUTF8)) | |
54 | self.fils.show() | |
55 | ratio=2 | |
56 | w=3*ratio | |
57 | h=5*ratio | |
58 | d=90/ratio | |
59 | self.fils.canvas=MyMplCanvas(self.fils.ui.grapheLabel,self.donnees, self.traitement, self.dates, width=w, height=h, dpi=d, cliquable=False, titre=self.titre) | |
60 | self.fils.canvas.show() | |
61 | ||
62 | def sizeHint(self): | |
63 | w, h = self.get_width_height() | |
64 | #print "w, h", w, h | |
65 | return QtCore.QSize(w, h) | |
66 | ||
67 | def minimumSizeHint(self): | |
68 | return QtCore.QSize(10, 10) | |
69 | ||
70 | def plot(self,donnees, traitement, dates): | |
71 | d=[] | |
72 | for dd in donnees: | |
73 | d.append(traitement(dd)) | |
74 | self.axes.plot(dates,d) | |
75 |
0 | <TeXmacs|1.0.6.11> | |
1 | ||
2 | <style|article> | |
3 | ||
4 | <\body> | |
5 | <doc-data|<doc-title|Méthodes utilisées dans le logiciel \S pysatellites | |
6 | \T>|<doc-author-data|<author-name|Georges Khaznadar | |
7 | >|<author-email|georgesk@ofset.org>>> | |
8 | ||
9 | <section|Utilité du logiciel \S pysatellites \T> | |
10 | ||
11 | Le logiciel pysatellites sert à simuler le lancement de satellites autour | |
12 | de diverses planètes. En France, ce logiciel est utilisé dans | |
13 | l'enseignement au niveau du lycée. L'élève est invité à choisir une | |
14 | planète, ou à préciser les paramètres de rayon et de masse qu'il veut, puis | |
15 | il contrôle le point de lancment d'un satellite, sa vitesse radiale et sa | |
16 | vitesse orthoradiale. Quand ce choix est fini, il lance la simulation et | |
17 | voit quelle trajectoire le satellite peut alors suivre. | |
18 | ||
19 | <section|Méthode utilisée pour la simulation> | |
20 | ||
21 | La méthode est une méthode de calcul de proche en proche : à des | |
22 | intervalles de temps réguliers, la vitesse et la position du satellite | |
23 | connues sont utilisées afin de prédire sa position et sa vitesse un | |
24 | intervalle de temps plus tard. On parle d'intégration numérique, car seule | |
25 | la loi locale qui donne la force d'attraction appliquée au satellite est | |
26 | prise en considération. | |
27 | ||
28 | Un autre méthode serait possible : dans le cas d'un problème à un corps | |
29 | plongé dans un potentiel newtonien, les équations de la dynamique du | |
30 | satellite admettent des solutions algébriques que l'on sait déterminer. | |
31 | J'ai utilisé un document synthétique publié sur Internet, à l'adresse\ | |
32 | ||
33 | <code*|http://melusine.eu.org/syracuse/immae/mpsi/physique-chimie/mecanique/08.pdf> | |
34 | ||
35 | Ce document résume ce qu'on peut retenir comme propriété des coniques | |
36 | (ellipses, parabole, hyperboles), et la solution connue du problème à un | |
37 | corps dans un potentiel newtonien. On peut l'utiliser pour calculer sans | |
38 | avoir à terminer la simulation divers paramètres. L'un d'entre eux est très | |
39 | important, il s'agit de la période <math|T> du mouvement quand l'énergie | |
40 | mécanique <math|E<rsub|m>> du satellite est négative, et que celui-ci | |
41 | décrit une ellipse dans le puits de potentiel de l'astre qui l'attire. | |
42 | ||
43 | <section|La méthode d'intégration de Runge-Kutta> | |
44 | ||
45 | <section|Détermination de la période d'un mouvement elliptique> | |
46 | ||
47 | On connaît la distance <math|r> du satellite à l'astre de masse <math|M>. | |
48 | On en déduit facilement son énergie potentielle massique, | |
49 | <math|E<rsub|p>/m=-<frac|GM|r>>, où <math|G=6,67.10<rsup|-11>u.s.i.> est la | |
50 | constante universelle de gravitation. Connaissant sa vitesse radiale | |
51 | <math|<wide|r<with|mode|text|<math|>>|\<dot\>>> et sa vitesse orthoradiale | |
52 | <math|r<wide|\<theta\>|\<dot\>>>, on déduit son énergie cinétique massique, | |
53 | <math|E<rsub|c>/m=<with|mode|text|<math|<wide|r|\<dot\>>>^2>+(<with|mode|text|<math|r<wide|\<theta\>|\<dot\>>>>)<rsup|2>>. | |
54 | Il suffit d'aditionner les énergies pour parvenir à l'énergie mécanique | |
55 | massique, <math|E<rsub|m>/m=-<frac|GM|r>+<with|mode|text|<math|<wide|r|\<dot\>>>^2>+(<with|mode|text|<math|r<wide|\<theta\>|\<dot\>>>>)<rsup|2>>. | |
56 | ||
57 | Plusieurs cas se présentent alors : | |
58 | ||
59 | <\enumerate-numeric> | |
60 | <item><math|E<rsub|m>/m \<less\> 0> : le satellite reste dans le puits de | |
61 | potentiel de l'astre, sa trajectoire est une ellipse, qu'il parcourt avec | |
62 | une période <math|T>. | |
63 | ||
64 | <item><with|mode|math|E<rsub|m>/m = 0> : le satellite n'est pas lié, il | |
65 | possède tout juste la vitesse de libération, sa trajectoire est une | |
66 | parabole, sa vitesse s'annule à l'infini. | |
67 | ||
68 | <item><with|mode|math|E<rsub|m>/m \<gtr\> 0> : le satellite n'est pas | |
69 | lié, sa vitesse à l'infini est non nulle, sa trajectoire est | |
70 | hyperbolique. | |
71 | </enumerate-numeric> | |
72 | ||
73 | Dans le premier cas seulement, une période existe pour le mouvement du | |
74 | satellite, et on la calcule ainsi : le grand axe <math|a> de l'ellipse se | |
75 | déduit de la constante d'attraction (<math|k=GMm)> par la formule <math|a = | |
76 | -k/2Em=<frac|-GM|2(-<frac|GM|r>+<with|mode|text|<math|<wide|r|\<dot\>>>^2>+(<with|mode|text|<math|r<wide|\<theta\>|\<dot\>>>>)<rsup|2>)>><math|>. | |
77 | Connaissant le grand axe <math|a> de l'ellipse, on peut alors déterminer la | |
78 | période <math|T> du mouvement grâce à la troisième loi de Kepler, | |
79 | <math|T<rsup|2>=4\<pi\><rsup|2>/MG*a<rsup|3>>, soit | |
80 | <math|T=2\<pi\><sqrt|<frac|1|MG*a<rsup|3>>|>>. | |
81 | ||
82 | Quand la période <math|T> du mouvement est connue, on peut prendre comme | |
83 | ordre de grandeur de l'intervalle de temps pour l'intégration, un centième | |
84 | de cette période. Ça donne des résultats satisfaisants pour les mouvement | |
85 | d'excentricité faible : c'est à dire que la trajectoire apparaît facilement | |
86 | comme fermée à l'écran, au pixel près. Dans le cas d'ellipses fortement | |
87 | excentriques, il faut diminuer le l'intervalle de temps utilisé pour | |
88 | l'intégration. | |
89 | </body> | |
90 | ||
91 | <\initial> | |
92 | <\collection> | |
93 | <associate|language|french> | |
94 | </collection> | |
95 | </initial> | |
96 | ||
97 | <\references> | |
98 | <\collection> | |
99 | <associate|auto-1|<tuple|1|1>> | |
100 | <associate|auto-2|<tuple|2|1>> | |
101 | <associate|auto-3|<tuple|3|1>> | |
102 | <associate|auto-4|<tuple|4|1>> | |
103 | </collection> | |
104 | </references> | |
105 | ||
106 | <\auxiliary> | |
107 | <\collection> | |
108 | <\associate|toc> | |
109 | <vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|1<space|2spc>Utilité | |
110 | du logiciel \S pysatellites \T> <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>> | |
111 | <no-break><pageref|auto-1><vspace|0.5fn> | |
112 | ||
113 | <vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|2<space|2spc>Méthode | |
114 | utilisée pour la simulation> <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>> | |
115 | <no-break><pageref|auto-2><vspace|0.5fn> | |
116 | ||
117 | <vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|3<space|2spc>La | |
118 | méthode d'intégration de Runge-Kutta> | |
119 | <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>> | |
120 | <no-break><pageref|auto-3><vspace|0.5fn> | |
121 | ||
122 | <vspace*|1fn><with|font-series|<quote|bold>|math-font-series|<quote|bold>|4<space|2spc>Détermination | |
123 | de la période d'un mouvement elliptique> | |
124 | <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>> | |
125 | <no-break><pageref|auto-4><vspace|0.5fn> | |
126 | </associate> | |
127 | </collection> | |
128 | </auxiliary>⏎ |
0 | #-*- coding: utf-8 -*- | |
1 | ||
2 | from PyQt4.QtCore import * | |
3 | from PyQt4.QtGui import * | |
4 | ||
5 | class Point(QLabel): | |
6 | def __init__(self, parent, point, color, numero, app, pred=None,type_de_point="petit"): | |
7 | """ | |
8 | Crée un point graphique. Paramètres : | |
9 | parent : widget parent | |
10 | point : coordonnées (de type vecteur) | |
11 | color : couleur | |
12 | numero : numéro à afficher | |
13 | app : l'application qui commande | |
14 | pred : le point prédecesseur | |
15 | type_de_point : un paramètre de style | |
16 | """ | |
17 | QLabel.__init__(self, parent) | |
18 | self.app=app | |
19 | self.point, self.color = point,color | |
20 | #self.setGeometry(QRect(0,0,640,480)) | |
21 | self.setGeometry(QRect(0,0,parent.width(),parent.height())) | |
22 | self.numero=numero | |
23 | self.type_de_point = type_de_point | |
24 | if type_de_point=="petit" : | |
25 | self.largeur=2 | |
26 | elif type_de_point=="gros" : | |
27 | self.largeur=4 | |
28 | else : | |
29 | self.largeur=2 | |
30 | ||
31 | def icone(self,nom): | |
32 | return self.app.rep.fichier("icones",nom) | |
33 | ||
34 | def paintEvent(self,event): | |
35 | self.painter = QPainter() | |
36 | self.painter.begin(self) | |
37 | self.painter.setPen(QColor(self.color)) | |
38 | self.painter.translate(self.point[0], self.point[1]) | |
39 | if self.type_de_point=="boum" : | |
40 | self.image_sat=QPixmap(self.icone("sat_mini_boum.png")) | |
41 | self.painter.drawPixmap(0,0,self.image_sat) | |
42 | elif self.type_de_point=="gros" : | |
43 | self.image_sat=QPixmap(self.icone("sat_mini.png")) | |
44 | self.painter.drawPixmap(0,0,self.image_sat) | |
45 | self.painter.drawLine(-self.largeur,0,self.largeur,0) | |
46 | self.painter.drawLine(0,-self.largeur,0,self.largeur) | |
47 | elif self.type_de_point=="petit" : | |
48 | self.painter.drawLine(-self.largeur,0,self.largeur,0) | |
49 | self.painter.drawLine(0,-self.largeur,0,self.largeur) | |
50 | ||
51 | self.painter.end() |
0 | <?xml version="1.0" encoding="UTF-8"?> | |
1 | <ui version="4.0"> | |
2 | <class>MainWindow</class> | |
3 | <widget class="QMainWindow" name="MainWindow"> | |
4 | <property name="geometry"> | |
5 | <rect> | |
6 | <x>0</x> | |
7 | <y>0</y> | |
8 | <width>1005</width> | |
9 | <height>690</height> | |
10 | </rect> | |
11 | </property> | |
12 | <property name="windowTitle"> | |
13 | <string>pySatellite, simulateur de trajectoire plane de satellites</string> | |
14 | </property> | |
15 | <widget class="QWidget" name="centralwidget"> | |
16 | <layout class="QHBoxLayout" name="horizontalLayout_2"> | |
17 | <item> | |
18 | <widget class="QLabel" name="afficheur"> | |
19 | <property name="sizePolicy"> | |
20 | <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | |
21 | <horstretch>0</horstretch> | |
22 | <verstretch>0</verstretch> | |
23 | </sizepolicy> | |
24 | </property> | |
25 | <property name="minimumSize"> | |
26 | <size> | |
27 | <width>560</width> | |
28 | <height>650</height> | |
29 | </size> | |
30 | </property> | |
31 | <property name="autoFillBackground"> | |
32 | <bool>true</bool> | |
33 | </property> | |
34 | <property name="styleSheet"> | |
35 | <string/> | |
36 | </property> | |
37 | <property name="frameShape"> | |
38 | <enum>QFrame::Panel</enum> | |
39 | </property> | |
40 | <property name="frameShadow"> | |
41 | <enum>QFrame::Raised</enum> | |
42 | </property> | |
43 | <property name="lineWidth"> | |
44 | <number>3</number> | |
45 | </property> | |
46 | <property name="text"> | |
47 | <string/> | |
48 | </property> | |
49 | </widget> | |
50 | </item> | |
51 | <item> | |
52 | <widget class="QFrame" name="frame"> | |
53 | <property name="sizePolicy"> | |
54 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | |
55 | <horstretch>0</horstretch> | |
56 | <verstretch>0</verstretch> | |
57 | </sizepolicy> | |
58 | </property> | |
59 | <property name="maximumSize"> | |
60 | <size> | |
61 | <width>245</width> | |
62 | <height>16777215</height> | |
63 | </size> | |
64 | </property> | |
65 | <property name="frameShape"> | |
66 | <enum>QFrame::StyledPanel</enum> | |
67 | </property> | |
68 | <property name="frameShadow"> | |
69 | <enum>QFrame::Raised</enum> | |
70 | </property> | |
71 | <layout class="QVBoxLayout" name="verticalLayout_2"> | |
72 | <item> | |
73 | <widget class="QGroupBox" name="groupBox_3"> | |
74 | <property name="title"> | |
75 | <string>Objet lancé</string> | |
76 | </property> | |
77 | <layout class="QFormLayout" name="formLayout"> | |
78 | <item row="0" column="0"> | |
79 | <widget class="QLabel" name="label_4"> | |
80 | <property name="text"> | |
81 | <string>Masse (kg)</string> | |
82 | </property> | |
83 | </widget> | |
84 | </item> | |
85 | <item row="0" column="1"> | |
86 | <widget class="QLineEdit" name="masse_objet"> | |
87 | <property name="text"> | |
88 | <string>100</string> | |
89 | </property> | |
90 | </widget> | |
91 | </item> | |
92 | <item row="1" column="0"> | |
93 | <widget class="QLabel" name="label_5"> | |
94 | <property name="text"> | |
95 | <string>altitude (km)</string> | |
96 | </property> | |
97 | </widget> | |
98 | </item> | |
99 | <item row="1" column="1"> | |
100 | <widget class="QLineEdit" name="altitude_objet"> | |
101 | <property name="text"> | |
102 | <string>1000</string> | |
103 | </property> | |
104 | </widget> | |
105 | </item> | |
106 | </layout> | |
107 | </widget> | |
108 | </item> | |
109 | <item> | |
110 | <widget class="QGroupBox" name="groupBox_4"> | |
111 | <property name="title"> | |
112 | <string>Vitesses au départ (m/s)</string> | |
113 | </property> | |
114 | <layout class="QFormLayout" name="formLayout_2"> | |
115 | <item row="0" column="0"> | |
116 | <widget class="QLabel" name="label_6"> | |
117 | <property name="text"> | |
118 | <string>Vx (tangentielle)</string> | |
119 | </property> | |
120 | </widget> | |
121 | </item> | |
122 | <item row="0" column="1"> | |
123 | <widget class="QLineEdit" name="vitesse_tangentielle_objet"> | |
124 | <property name="text"> | |
125 | <string>-4000</string> | |
126 | </property> | |
127 | </widget> | |
128 | </item> | |
129 | <item row="1" column="0"> | |
130 | <widget class="QLabel" name="label_7"> | |
131 | <property name="text"> | |
132 | <string>Vy (normale)</string> | |
133 | </property> | |
134 | </widget> | |
135 | </item> | |
136 | <item row="1" column="1"> | |
137 | <widget class="QLineEdit" name="vitesse_normale_objet"> | |
138 | <property name="text"> | |
139 | <string>0</string> | |
140 | </property> | |
141 | </widget> | |
142 | </item> | |
143 | </layout> | |
144 | </widget> | |
145 | </item> | |
146 | <item> | |
147 | <widget class="QGroupBox" name="groupBox_5"> | |
148 | <property name="title"> | |
149 | <string>Astre défini</string> | |
150 | </property> | |
151 | <layout class="QGridLayout" name="gridLayout_3"> | |
152 | <item row="0" column="0"> | |
153 | <widget class="QLabel" name="label_11"> | |
154 | <property name="text"> | |
155 | <string>Masse (kg)</string> | |
156 | </property> | |
157 | </widget> | |
158 | </item> | |
159 | <item row="0" column="1"> | |
160 | <widget class="QLineEdit" name="masse_astre"> | |
161 | <property name="text"> | |
162 | <string>6*10^24</string> | |
163 | </property> | |
164 | </widget> | |
165 | </item> | |
166 | <item row="1" column="0"> | |
167 | <widget class="QLabel" name="label_10"> | |
168 | <property name="text"> | |
169 | <string>Rayon (km)</string> | |
170 | </property> | |
171 | </widget> | |
172 | </item> | |
173 | <item row="1" column="1"> | |
174 | <widget class="QLineEdit" name="rayon_astre"/> | |
175 | </item> | |
176 | </layout> | |
177 | </widget> | |
178 | </item> | |
179 | <item> | |
180 | <widget class="QGroupBox" name="groupBox"> | |
181 | <property name="sizePolicy"> | |
182 | <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> | |
183 | <horstretch>0</horstretch> | |
184 | <verstretch>0</verstretch> | |
185 | </sizepolicy> | |
186 | </property> | |
187 | <property name="title"> | |
188 | <string>Astres connus</string> | |
189 | </property> | |
190 | <layout class="QGridLayout" name="gridLayout_2"> | |
191 | <item row="0" column="0" colspan="2"> | |
192 | <widget class="QComboBox" name="astreCombo"/> | |
193 | </item> | |
194 | <item row="1" column="0"> | |
195 | <widget class="QLineEdit" name="mTerre"> | |
196 | <property name="sizePolicy"> | |
197 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> | |
198 | <horstretch>0</horstretch> | |
199 | <verstretch>0</verstretch> | |
200 | </sizepolicy> | |
201 | </property> | |
202 | <property name="minimumSize"> | |
203 | <size> | |
204 | <width>100</width> | |
205 | <height>0</height> | |
206 | </size> | |
207 | </property> | |
208 | </widget> | |
209 | </item> | |
210 | <item row="1" column="1"> | |
211 | <widget class="QLabel" name="label_12"> | |
212 | <property name="text"> | |
213 | <string>M. terrestres</string> | |
214 | </property> | |
215 | </widget> | |
216 | </item> | |
217 | <item row="2" column="0"> | |
218 | <widget class="QLineEdit" name="rTerre"> | |
219 | <property name="sizePolicy"> | |
220 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> | |
221 | <horstretch>0</horstretch> | |
222 | <verstretch>0</verstretch> | |
223 | </sizepolicy> | |
224 | </property> | |
225 | <property name="minimumSize"> | |
226 | <size> | |
227 | <width>100</width> | |
228 | <height>0</height> | |
229 | </size> | |
230 | </property> | |
231 | </widget> | |
232 | </item> | |
233 | <item row="3" column="0" colspan="2"> | |
234 | <widget class="QTextEdit" name="auSujetAstre"> | |
235 | <property name="sizePolicy"> | |
236 | <sizepolicy hsizetype="Expanding" vsizetype="Maximum"> | |
237 | <horstretch>0</horstretch> | |
238 | <verstretch>0</verstretch> | |
239 | </sizepolicy> | |
240 | </property> | |
241 | <property name="maximumSize"> | |
242 | <size> | |
243 | <width>16777215</width> | |
244 | <height>46</height> | |
245 | </size> | |
246 | </property> | |
247 | </widget> | |
248 | </item> | |
249 | <item row="2" column="1"> | |
250 | <widget class="QLabel" name="label_13"> | |
251 | <property name="minimumSize"> | |
252 | <size> | |
253 | <width>0</width> | |
254 | <height>0</height> | |
255 | </size> | |
256 | </property> | |
257 | <property name="text"> | |
258 | <string>R. terrestres</string> | |
259 | </property> | |
260 | </widget> | |
261 | </item> | |
262 | </layout> | |
263 | </widget> | |
264 | </item> | |
265 | <item> | |
266 | <widget class="QGroupBox" name="groupBox_8"> | |
267 | <property name="title"> | |
268 | <string>Visualiser le satellite</string> | |
269 | </property> | |
270 | <layout class="QHBoxLayout" name="horizontalLayout"> | |
271 | <item> | |
272 | <widget class="QLabel" name="label_2"> | |
273 | <property name="text"> | |
274 | <string>chaque ...</string> | |
275 | </property> | |
276 | </widget> | |
277 | </item> | |
278 | <item> | |
279 | <widget class="QLineEdit" name="intervale"> | |
280 | <property name="text"> | |
281 | <string>3600</string> | |
282 | </property> | |
283 | </widget> | |
284 | </item> | |
285 | <item> | |
286 | <widget class="QLabel" name="label_20"> | |
287 | <property name="accessibleDescription"> | |
288 | <string>temps entre chaque point</string> | |
289 | </property> | |
290 | <property name="text"> | |
291 | <string>s</string> | |
292 | </property> | |
293 | <property name="alignment"> | |
294 | <set>Qt::AlignCenter</set> | |
295 | </property> | |
296 | </widget> | |
297 | </item> | |
298 | </layout> | |
299 | </widget> | |
300 | </item> | |
301 | <item> | |
302 | <widget class="QGroupBox" name="groupBox_7"> | |
303 | <property name="title"> | |
304 | <string>Actions</string> | |
305 | </property> | |
306 | <layout class="QGridLayout" name="gridLayout"> | |
307 | <item row="0" column="0"> | |
308 | <widget class="QPushButton" name="Bouton_Lancer"> | |
309 | <property name="text"> | |
310 | <string>Lancer l'objet</string> | |
311 | </property> | |
312 | </widget> | |
313 | </item> | |
314 | <item row="0" column="1"> | |
315 | <widget class="QPushButton" name="Button_efface"> | |
316 | <property name="text"> | |
317 | <string>Effacer</string> | |
318 | </property> | |
319 | </widget> | |
320 | </item> | |
321 | <item row="1" column="0"> | |
322 | <widget class="QPushButton" name="bouton_video"> | |
323 | <property name="text"> | |
324 | <string>Vidéo</string> | |
325 | </property> | |
326 | </widget> | |
327 | </item> | |
328 | <item row="1" column="1"> | |
329 | <widget class="QCheckBox" name="checkBox_efface"> | |
330 | <property name="sizePolicy"> | |
331 | <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> | |
332 | <horstretch>0</horstretch> | |
333 | <verstretch>0</verstretch> | |
334 | </sizepolicy> | |
335 | </property> | |
336 | <property name="text"> | |
337 | <string>chaque fois</string> | |
338 | </property> | |
339 | </widget> | |
340 | </item> | |
341 | </layout> | |
342 | </widget> | |
343 | </item> | |
344 | </layout> | |
345 | </widget> | |
346 | </item> | |
347 | <item> | |
348 | <widget class="QGroupBox" name="groupBox_2"> | |
349 | <property name="sizePolicy"> | |
350 | <sizepolicy hsizetype="Maximum" vsizetype="Preferred"> | |
351 | <horstretch>0</horstretch> | |
352 | <verstretch>0</verstretch> | |
353 | </sizepolicy> | |
354 | </property> | |
355 | <property name="maximumSize"> | |
356 | <size> | |
357 | <width>170</width> | |
358 | <height>16777215</height> | |
359 | </size> | |
360 | </property> | |
361 | <property name="title"> | |
362 | <string>Vitesses</string> | |
363 | </property> | |
364 | <layout class="QVBoxLayout" name="verticalLayout"> | |
365 | <item> | |
366 | <widget class="QRadioButton" name="radioButton_Cartesiennes"> | |
367 | <property name="text"> | |
368 | <string>coord. cartésiennes</string> | |
369 | </property> | |
370 | <property name="checked"> | |
371 | <bool>true</bool> | |
372 | </property> | |
373 | </widget> | |
374 | </item> | |
375 | <item> | |
376 | <widget class="QRadioButton" name="radioButton_Frenet"> | |
377 | <property name="text"> | |
378 | <string>repère de frénet</string> | |
379 | </property> | |
380 | <property name="checked"> | |
381 | <bool>false</bool> | |
382 | </property> | |
383 | </widget> | |
384 | </item> | |
385 | <item> | |
386 | <widget class="QLabel" name="label_V1"> | |
387 | <property name="text"> | |
388 | <string>Vitesse selon OX</string> | |
389 | </property> | |
390 | </widget> | |
391 | </item> | |
392 | <item> | |
393 | <widget class="QLabel" name="label_vitx"> | |
394 | <property name="sizePolicy"> | |
395 | <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | |
396 | <horstretch>0</horstretch> | |
397 | <verstretch>0</verstretch> | |
398 | </sizepolicy> | |
399 | </property> | |
400 | <property name="minimumSize"> | |
401 | <size> | |
402 | <width>101</width> | |
403 | <height>141</height> | |
404 | </size> | |
405 | </property> | |
406 | <property name="toolTip"> | |
407 | <string>Cliquez pour agrandir</string> | |
408 | </property> | |
409 | <property name="frameShape"> | |
410 | <enum>QFrame::Box</enum> | |
411 | </property> | |
412 | <property name="text"> | |
413 | <string/> | |
414 | </property> | |
415 | </widget> | |
416 | </item> | |
417 | <item> | |
418 | <widget class="QLabel" name="label_V2"> | |
419 | <property name="text"> | |
420 | <string>Vitesse selon OY</string> | |
421 | </property> | |
422 | </widget> | |
423 | </item> | |
424 | <item> | |
425 | <widget class="QLabel" name="label_vity"> | |
426 | <property name="sizePolicy"> | |
427 | <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | |
428 | <horstretch>0</horstretch> | |
429 | <verstretch>0</verstretch> | |
430 | </sizepolicy> | |
431 | </property> | |
432 | <property name="minimumSize"> | |
433 | <size> | |
434 | <width>101</width> | |
435 | <height>141</height> | |
436 | </size> | |
437 | </property> | |
438 | <property name="toolTip"> | |
439 | <string>Cliquez pour agrandir</string> | |
440 | </property> | |
441 | <property name="frameShape"> | |
442 | <enum>QFrame::Box</enum> | |
443 | </property> | |
444 | <property name="text"> | |
445 | <string/> | |
446 | </property> | |
447 | </widget> | |
448 | </item> | |
449 | <item> | |
450 | <widget class="QLabel" name="label_14"> | |
451 | <property name="text"> | |
452 | <string>Norme de la vitesse</string> | |
453 | </property> | |
454 | </widget> | |
455 | </item> | |
456 | <item> | |
457 | <widget class="QLabel" name="label_vit_norm"> | |
458 | <property name="sizePolicy"> | |
459 | <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | |
460 | <horstretch>0</horstretch> | |
461 | <verstretch>0</verstretch> | |
462 | </sizepolicy> | |
463 | </property> | |
464 | <property name="minimumSize"> | |
465 | <size> | |
466 | <width>101</width> | |
467 | <height>141</height> | |
468 | </size> | |
469 | </property> | |
470 | <property name="toolTip"> | |
471 | <string>Cliquez pour agrandir</string> | |
472 | </property> | |
473 | <property name="frameShape"> | |
474 | <enum>QFrame::Box</enum> | |
475 | </property> | |
476 | <property name="text"> | |
477 | <string/> | |
478 | </property> | |
479 | </widget> | |
480 | </item> | |
481 | <item> | |
482 | <widget class="QLabel" name="label"> | |
483 | <property name="text"> | |
484 | <string>(Cliquez pour agrandir)</string> | |
485 | </property> | |
486 | </widget> | |
487 | </item> | |
488 | </layout> | |
489 | </widget> | |
490 | </item> | |
491 | </layout> | |
492 | </widget> | |
493 | <widget class="QStatusBar" name="statusbar"/> | |
494 | </widget> | |
495 | <resources/> | |
496 | <connections> | |
497 | <connection> | |
498 | <sender>Button_efface</sender> | |
499 | <signal>pressed()</signal> | |
500 | <receiver>afficheur</receiver> | |
501 | <slot>clear()</slot> | |
502 | <hints> | |
503 | <hint type="sourcelabel"> | |
504 | <x>244</x> | |
505 | <y>579</y> | |
506 | </hint> | |
507 | <hint type="destinationlabel"> | |
508 | <x>241</x> | |
509 | <y>519</y> | |
510 | </hint> | |
511 | </hints> | |
512 | </connection> | |
513 | </connections> | |
514 | </ui> |
0 | .\" Title: PYSATELLITES | |
1 | .\" Author: | |
2 | .\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/> | |
3 | .\" Date: mai 14, 2008 | |
4 | .\" Manual: | |
5 | .\" Source: | |
6 | .\" | |
7 | .TH "PYSATELLITES" "1" "mai 14, 2008" "" "" | |
8 | .\" disable hyphenation | |
9 | .nh | |
10 | .\" disable justification (adjust text to left margin only) | |
11 | .ad l | |
12 | .SH "NAME" | |
13 | pysatellites - simulates the launching of satellites | |
14 | .SH "SYNOPSIS" | |
15 | .HP 13 | |
16 | \fBpysatellites\fR [\fB\-d\ \fR\fB\fIdebuglevel\fR\fR] [\fB\-\-debug=\fR\fB\fIdebuglevel\fR\fR] [\fB\-f\ \fR\fB\fIfile\fR\fR] [\fB\-\-fichier=\fR\fB\fIfile\fR\fR] [\fB\-h\ \fR] [\fB\-\-help\fR] | |
17 | .SH "DESCRIPTION" | |
18 | .PP | |
19 | This program can be used to train people to spatial mechanics at an elementary level\. You are given the power to launch a satellite, from outside the atmosphere, around a handfull of predefined planets, or around any special object you may imagine\. Input the intial velocity vector of the satellite, and you will get the simulated trajectory, as well as some informations like the plots of variation of speed\. As an extra, you can compute a movie, which represents the planet seen from the satellite\'s point of view during its orbital period\. | |
20 | .SH "OPTIONS" | |
21 | .PP | |
22 | \fB\-h\fR \fB\-\-help\fR | |
23 | .RS 4 | |
24 | Show a short usage description\. | |
25 | .RE | |
26 | .PP | |
27 | \fB\-d \fR\fB\fIdebuglevel\fR\fR \fB\-\-debug=\fR\fB\fIdebuglevel\fR\fR | |
28 | .RS 4 | |
29 | Sets the debug level, from 0 to 10 (default = 0)\. | |
30 | .RE | |
31 | .PP | |
32 | \fB\-f \fR\fB\fIfile\fR\fR \fB\-\-fichier=\fR\fB\fIfile\fR\fR | |
33 | .RS 4 | |
34 | Sets the configuration file (default: none) | |
35 | .RE | |
36 | .SH "COPYRIGHT" | |
37 | Copyright \(co 2008 Georges Khaznadar | |
38 | .br |
0 | [Desktop Entry] | |
1 | Name=pySatellites | |
2 | Comment=Interactive simulator for launching satellites | |
3 | Comment[fr_FR.UTF-8]=Simulateur interactif de lancement de satellites | |
4 | Exec=pysatellites | |
5 | Icon=pysatellites | |
6 | Terminal=false | |
7 | Type=Application | |
8 | Categories=Video;Education;Science; |
0 | #-*- coding: utf-8 -*- | |
1 | ||
2 | licence=""" | |
3 | pysatellites : a program to plot trajectories of satellites | |
4 | Copyright (C) 2007-2008 Jean-Baptiste Butet <ashashiwa@gmail.com>, | |
5 | (C) 2007-2008 Georges Khaznadar <georgesk@ofset.org> | |
6 | ||
7 | ||
8 | This program is free software: you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation, either version 3 of the License, or | |
11 | (at your option) any later version. | |
12 | ||
13 | This program is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
19 | along with this program. If not, see <http://www.gnu.org/licenses/>. | |
20 | """ | |
21 | ||
22 | licence_fr=""" | |
23 | pysatellites : un programme pour tracer les trajectoires de satellites | |
24 | Copyright (C) 2007-2008 Jean-Baptiste Butet <ashashiwa@gmail.com>, | |
25 | (C) 2007-2008 Georges Khaznadar <georgesk@ofset.org> | |
26 | ||
27 | Ce projet est un logiciel libre : vous pouvez le redistribuer, le modifier selon les terme de la GPL (GNU Public License) dans les termes de la Free Software Foundation concernant la version 3 ou plus de la dite licence. | |
28 | ||
29 | Ce programme est fait avec l'espoir qu'il sera utile mais SANS AUCUNE GARANTIE. Lisez la licence pour plus de détails. | |
30 | ||
31 | <http://www.gnu.org/licenses/>. | |
32 | """ | |
33 | ||
34 | import sys | |
35 | from PyQt4.QtCore import * | |
36 | from PyQt4.QtGui import * | |
37 | from debug import Debug | |
38 | from mainWindow import StartQT4 | |
39 | ||
40 | ||
41 | ||
42 | ||
43 | def usage(): | |
44 | print ("Usage : pysatellites [-h | --help] [-d n | --debug=n] [-f fichier | --fichier=fichier]") | |
45 | sys.exit(0) | |
46 | ||
47 | def run(): | |
48 | app = QApplication(sys.argv) | |
49 | ||
50 | #translation | |
51 | #locale = QLocale.system().name() | |
52 | ||
53 | #qtTranslator = QTranslator() | |
54 | #if qtTranslator.load("qt_" + locale): | |
55 | # app.installTranslator(qtTranslator) | |
56 | #appTranslator = QTranslator() | |
57 | ||
58 | # if appTranslator.load("lang/pyfocus_" + locale): | |
59 | #app.installTranslator(appTranslator) | |
60 | ||
61 | from getopt import getopt | |
62 | optlist, argv=getopt(sys.argv[1:],"d:f:h",["debug=","fichier=","help"]) | |
63 | ||
64 | debugger=Debug(0) | |
65 | for (cle,val) in optlist: | |
66 | if cle=="-d" or cle=="--debug": | |
67 | debugger=Debug(int(val)) | |
68 | if cle=="-h" or cle=="--help": | |
69 | usage() | |
70 | if cle=="-f" or cle=="--fichier": | |
71 | print ("On ne sait pas encore quoi faire de '%s', la fonctionnalité gouvernée par '%s' reste à implémenter." %(val,cle)) | |
72 | ||
73 | windows = StartQT4(None, debugger=debugger, app=app) | |
74 | windows.show() | |
75 | sys.exit(app.exec_()) | |
76 | ||
77 | if __name__ == "__main__": | |
78 | run() |
0 | # -*- coding: utf-8 -*- | |
1 | ||
2 | from PyQt4.QtGui import * | |
3 | from PyQt4.QtCore import * | |
4 | from debug import Debug | |
5 | ||
6 | class Rs(QWidget): | |
7 | def __init__(self, parent, geometry=None, | |
8 | image=None, text=None, | |
9 | color=QColor("grey"), | |
10 | debuglevel=0, | |
11 | onPress=None, | |
12 | onRelease=None, | |
13 | onDoubleClick=None, | |
14 | onMove=None, | |
15 | debugger=Debug(0)): | |
16 | QWidget.__init__(self,parent) | |
17 | if geometry==None: # le widget recouvrira le parent | |
18 | if parent!=None: | |
19 | self.setGeometry(QRect(0,0,parent.width(),parent.height())) | |
20 | else: | |
21 | self.setGeometry(QRect(0,0,100,100)) | |
22 | else: | |
23 | self.setGeometry(geometry) | |
24 | self.setMouseTracking(True) | |
25 | self.image=image | |
26 | self.text=text | |
27 | self.color=color | |
28 | self.debug=debugger | |
29 | self.onPress=onPress | |
30 | self.onRelease=onRelease | |
31 | self.onDoubleClick=onDoubleClick | |
32 | self.onMove=onMove | |
33 | ||
34 | def mousePressEvent(self,ev): | |
35 | if self.onPress != None: | |
36 | return self.onPress(ev) | |
37 | else: | |
38 | self.debug(9, "event onPress still to implement") | |
39 | def mouseReleaseEvent(self,ev): | |
40 | if self.onRelease != None: | |
41 | return self.onRelease(ev) | |
42 | else: | |
43 | self.debug(9, "event onRelease still to implement") | |
44 | def mouseMoveEvent(self,ev): | |
45 | if self.onMove != None: | |
46 | return self.onMove(ev) | |
47 | else: | |
48 | self.debug(9, "event onMove still to implement ... x=%s, y=%s" %(ev.x(),ev.y())) | |
49 | def mouseDoubleClickEvent(self,ev): | |
50 | if self.onDoubleClick != None: | |
51 | return self.onDoubleClick(ev) | |
52 | else: | |
53 | self.debug(9, "event onDoubleClick still to implement") | |
54 | ||
55 | def paintEvent(self, event): | |
56 | QWidget.paintEvent(self,event) | |
57 | self.painter = QPainter() | |
58 | self.painter.begin(self) | |
59 | if self.color !=None: | |
60 | self.painter.fillRect(QRect(0,0,self.width(),self.height()), | |
61 | self.color) | |
62 | if self.image != None: | |
63 | self.painter.drawImage(0,0,self.image) | |
64 | if self.text != None: | |
65 | self.painter.drawText(0,0,self.text) | |
66 | self.painter.end() | |
67 | ||
68 | class RsImage(Rs): | |
69 | """Une classe dérivée du rectangle sensible Rs, qui contient | |
70 | une image et se place en x,y sur le parent | |
71 | """ | |
72 | def __init__(self, parent, x, y, image, | |
73 | text=None, | |
74 | color=QColor("grey"), | |
75 | onPress=None, | |
76 | onRelease=None, | |
77 | onDoubleClick=None, | |
78 | onMove=None, | |
79 | debugger=Debug(0)): | |
80 | rect=QRect(x,y,image.size().width(), image.size().height()) | |
81 | Rs.__init__(self, parent, rect, image=image, | |
82 | text=None, | |
83 | color=color, | |
84 | onPress=onPress, | |
85 | onRelease=onRelease, | |
86 | onDoubleClick=onDoubleClick, | |
87 | onMove=onMove, | |
88 | debugger=debugger) |
0 | # -*- coding: utf-8 -*- | |
1 | ||
2 | import os.path | |
3 | ||
4 | class repertoire: | |
5 | def __init__(self, chemin): | |
6 | self.chemin0=os.path.abspath(chemin) | |
7 | if os.path.isfile(self.chemin0): | |
8 | self.chemin0=os.path.dirname(self.chemin0) | |
9 | ||
10 | def chemin(self,choix="defaut"): | |
11 | if choix=="defaut": | |
12 | return self.chemin0 | |
13 | if choix=="textures": | |
14 | for d in [self.chemin0, "/usr/share/pysatellites"]: | |
15 | if os.path.exists(d+'/images/earth-clouds.jpg'): | |
16 | return d | |
17 | print ("erreur : pas de répertoire des planètes") | |
18 | print ("=== Il manque les textures de Stellarium ===") | |
19 | raise(IOError) | |
20 | elif os.path.isdir(os.path.join(self.chemin0,choix)): | |
21 | return os.path.join(self.chemin0,choix) | |
22 | else: | |
23 | raise(IOError) | |
24 | def fichier(self,*elementsDeChemin): | |
25 | f=self.chemin0 | |
26 | for e in elementsDeChemin: | |
27 | f=os.path.join(f,e) | |
28 | return f | |
29 |
0 | # -*- coding: utf-8 -*- | |
1 | # Résolution numérique d'un problème à un corps soumis à un | |
2 | # potentiel newtonien (en 1/r^2) | |
3 | # d'équa. diff. vec{r}'' = -k/m vec{r}/r^3 | |
4 | # le vecteur de données considéré sera le vecteur (x, y , vx, vy) | |
5 | # dont la dérivée est (vx, vy, -k/m*x/(x^2+y^2)^3/2, -k/m*y/(x^2+y^2)^3/2) | |
6 | ||
7 | from numpy import * | |
8 | from pylab import * | |
9 | from PyQt4.QtCore import * | |
10 | from PyQt4.QtGui import * | |
11 | from point import Point | |
12 | import os, tempfile, time | |
13 | from matplotlib_widget import MyMplCanvas | |
14 | import flottant as flottant | |
15 | from rectangle_sensible import Rs | |
16 | from debug import Debug | |
17 | ||
18 | def rk4(derivs, y0, t): | |
19 | """ | |
20 | C'est le code de rk4 pris dans le module matplotplib. | |
21 | ||
22 | Liste des paramètres d'entrée | |
23 | ||
24 | derivs : | |
25 | une fonction qui accepte en entrée un 6-uplet position,vitesse | |
26 | et le papramètre temps, et qui renvoie en sortie un 6-uplet de dérivées. | |
27 | y0 : | |
28 | un 6-uplet représentant la position et la vitesse initiales | |
29 | t : | |
30 | une liste de dates régulièrement espacées pour lesquelles on veut | |
31 | construire les points et vitessesde la trajectoire | |
32 | ||
33 | Résultat de la fonction : | |
34 | une liste de 6-uplets représentant les positions et vitesses aux | |
35 | instants de la liste des dates données. | |
36 | """ | |
37 | Float=0.0 | |
38 | try: Ny = len(y0) | |
39 | except TypeError: | |
40 | yout = zeros( (len(t),), float) | |
41 | else: | |
42 | yout = zeros( (len(t), Ny), float) | |
43 | yout[0] = y0 | |
44 | i = 0 | |
45 | for i in arange(len(t)-1): | |
46 | thist = t[i] | |
47 | dt = t[i+1] - thist | |
48 | dt2 = dt/2.0 | |
49 | y0 = yout[i] | |
50 | k1 = asarray(derivs(y0, thist)) | |
51 | k2 = asarray(derivs(y0 + dt2*k1, thist+dt2)) | |
52 | k3 = asarray(derivs(y0 + dt2*k2, thist+dt2)) | |
53 | k4 = asarray(derivs(y0 + dt*k3, thist+dt)) | |
54 | yout[i+1] = y0 + dt/6.0*(k1 + 2*k2 + 2*k3 + k4) | |
55 | return yout | |
56 | ||
57 | ||
58 | def euler(derivs, y0, t): | |
59 | """ | |
60 | C'est le code de la méthode d'Euler, qui est d'ordre 1 et très simple. | |
61 | ||
62 | Liste des paramètres d'entrée | |
63 | ||
64 | derivs : | |
65 | une fonction qui accepte en entrée un 6-uplet position,vitesse | |
66 | et le papramètre temps, et qui renvoie en sortie un 6-uplet de dérivées. | |
67 | y0 : | |
68 | un 6-uplet représentant la position et la vitesse initiales | |
69 | t : | |
70 | une liste de dates régulièrement espacées pour lesquelles on veut | |
71 | construire les points et vitessesde la trajectoire | |
72 | ||
73 | Résultat de la fonction : | |
74 | une liste de 6-uplets représentant les positions et vitesses aux | |
75 | instants de la liste des dates données. | |
76 | """ | |
77 | try: Ny = len(y0) | |
78 | except TypeError: | |
79 | yout = zeros( (len(t),), Float) | |
80 | else: | |
81 | yout = zeros( (len(t), Ny), Float) | |
82 | yout[0] = y0 | |
83 | i = 0 | |
84 | for i in arange(len(t)-1): | |
85 | thist = t[i] | |
86 | dt = t[i+1] - thist | |
87 | y0 = yout[i] | |
88 | k1 = asarray(derivs(y0, thist)) | |
89 | yout[i+1] = y0 + dt*k1 | |
90 | return yout | |
91 | ||
92 | def nouvChampGrav(x0,m): | |
93 | """Cette fonction renvoie une fonction anonyme représentant un champ | |
94 | gravitationnel créé par un objet de masse m immobile aux coordonnées | |
95 | spécifiées par x0. | |
96 | le profil de la fonction résultat est : | |
97 | (vecteur position -> vecteur accélération) | |
98 | """ | |
99 | return lambda x: (-6.67e-11*m*(x[0]-x0[0])/((x[0]-x0[0])**2+(x[1]-x0[1])**2+(x[2]-x0[2])**2)**1.5, | |
100 | -6.67e-11*m*(x[1]-x0[1])/((x[0]-x0[0])**2+(x[1]-x0[1])**2+(x[2]-x0[2])**2)**1.5, | |
101 | -6.67e-11*m*(x[2]-x0[2])/((x[0]-x0[0])**2+(x[1]-x0[1])**2+(x[2]-x0[2])**2)**(1.5)) | |
102 | ||
103 | class trajectoire(QObject): | |
104 | def __init__(self,dt,t,y0, champ): | |
105 | """Les paramètres sont : | |
106 | dt : intervalle de temps | |
107 | t : durée totale de la simulation | |
108 | y0 : vecteur à 6 composantes (position, vitesse initiales) | |
109 | champ : une fonction donnant l'accélération à partir de la position | |
110 | """ | |
111 | QObject.__init__(self) | |
112 | self.dt = dt | |
113 | self.t = arange(0,t,self.dt) | |
114 | self.y0 = y0 | |
115 | self.champ=champ | |
116 | self.calcul() | |
117 | ||
118 | def dessine(self): | |
119 | x=[] | |
120 | y=[] | |
121 | for point in self.pv : | |
122 | x.append(point[0]) | |
123 | y.append(point[1]) | |
124 | self.x = x | |
125 | self.y = y | |
126 | ||
127 | plot(self.x,self.y) # le dessin est en projection dans le plan x,y | |
128 | axis('equal') | |
129 | show() | |
130 | ||
131 | def derivs(self,x,t): | |
132 | """calcul de la dérivée du vecteur à 6 composantes position,vitesse | |
133 | """ | |
134 | g = self.champ(x[0:3]) # le champ de gravité | |
135 | return (x[3], # vitesse x | |
136 | x[4], # vitesse y | |
137 | x[5], # vitesse z | |
138 | g[0], # acceleration x | |
139 | g[1], # acceleration y | |
140 | g[2]) # acceleration z | |
141 | ||
142 | def calcul(self): | |
143 | """lance le calcul de la trajectoire à l'aide de l'algorithme de | |
144 | Runge-Kutta qui est d'ordre 4 et rapide en même temps. | |
145 | le résultat est dans self.pv, qui est une liste contenant | |
146 | les 6-uplets position, vitesse. | |
147 | """ | |
148 | self.pv = rk4(self.derivs, self.y0, self.t) | |
149 | ||
150 | ||
151 | def calculeNorme(nuplet): | |
152 | s=0 | |
153 | for x in nuplet: | |
154 | s+=x**2 | |
155 | return s**0.5 | |
156 | ||
157 | def projection(n): | |
158 | if n >=0: | |
159 | return lambda nuplet:nuplet[n] | |
160 | else: | |
161 | return 0.0 | |
162 | ||
163 | class Trajectoire(Rs): | |
164 | def __init__(self, parent, rayon_astre, mainWin, debugger=Debug(0)): | |
165 | Rs.__init__(self, parent, debugger=debugger) | |
166 | self.parent = parent | |
167 | self.mainWin=mainWin | |
168 | self.milieuX=self.width()/2 | |
169 | self.milieuY=self.height()/2 | |
170 | self.rep= mainWin.rep | |
171 | #self.setFrameShape(QFrame.Box) | |
172 | self.setEchelle(6.4e6/25) | |
173 | self.points={} | |
174 | self.planetes={} | |
175 | self.vitesse=[] | |
176 | self.date=[] | |
177 | self.dt=1 | |
178 | self.widget_vit_norm=None | |
179 | self.widget_vitx=None | |
180 | self.widget_vity=None | |
181 | self.boum=-1.0 | |
182 | self.traj=None | |
183 | ||
184 | ||
185 | def setEchelle(self,val, mode="mppx"): | |
186 | """ Régle l'échelle, selon le mode choisi. | |
187 | mode=mppx : échelle en mètre par pixel | |
188 | mode=max : l'échelle sera ajustée pour que le point (0,val) soit dans | |
189 | la fenêtre de trajectoire (à 95% du maximum) | |
190 | """ | |
191 | if mode=="mppx": | |
192 | self.echelle=val | |
193 | self.debug(9,"Échelle %s px/m (mode direct)" %self.echelle) | |
194 | elif mode=="max": | |
195 | self.echelle=val/self.milieuY/0.95 | |
196 | self.debug(9,"%s m pour %s px" %(val,self.milieuY)) | |
197 | self.debug(9,"Échelle %s px/m (mode max)" %self.echelle) | |
198 | else: | |
199 | self.debug(0,"Le mode %s ne convient pas pour setEchelle()" %mode) | |
200 | ||
201 | def lance(self): | |
202 | self.calcul_parametre() | |
203 | if self.mainWin.ui.checkBox_efface.isChecked() : | |
204 | self.efface() | |
205 | self.debug(10,"efface la trajectoire depuis un lancé") | |
206 | a=time.time() | |
207 | ||
208 | self.traj= trajectoire(self.dt, self.t, self.pos+self.vit, self.gAstre) | |
209 | self.debug(8, "%s, %s, %s, %s" %(self.dt, self.t, self.pos+self.vit, self.gAstre)) | |
210 | self.debug(5,"calcul en %s secondes" %(time.time()-a)) | |
211 | self.dessine_trajectoire() | |
212 | #dessine les vitesses | |
213 | self.grapheV() | |
214 | ||
215 | def grapheV(self): | |
216 | if self.widget_vit_norm != None: | |
217 | self.widget_vit_norm.hide() | |
218 | if self.widget_vitx != None: | |
219 | self.widget_vitx.hide() | |
220 | if self.widget_vity != None: | |
221 | self.widget_vity.hide() | |
222 | self.widget_vit_norme = MyMplCanvas(self.mainWin.ui.label_vit_norm,self.vitesse, calculeNorme, self.date, width=3, height=5, dpi=30, cliquable=True, titre="Norme de la vitesse") | |
223 | self.widget_vitx = MyMplCanvas(self.mainWin.ui.label_vitx,self.vitesse, projection(0), self.date, width=3, height=5, dpi=30, cliquable=True, titre="Abscisse de la vitesse") | |
224 | self.widget_vity = MyMplCanvas(self.mainWin.ui.label_vity,self.vitesse, projection(1), self.date, width=3, height=5, dpi=30, cliquable=True, titre="Ordonnée de la vitesse") | |
225 | self.widget_vit_norme.show() | |
226 | self.widget_vitx.show() | |
227 | self.widget_vity.show() | |
228 | ||
229 | ||
230 | def calcul_parametre(self): | |
231 | self.masse_astre = self.mainWin.getMasseAstre() | |
232 | self.distance_astre = self.mainWin.getDistanceAstre() | |
233 | self.vitesse_x,self.vitesse_y = self.mainWin.getVitesse() | |
234 | ||
235 | self.G=6.67259e-11 | |
236 | #calcul des énergies massiques (cinétique, potentielle, mécanique) | |
237 | Ec_massique=0.5*(self.vitesse_x**2+self.vitesse_y**2) | |
238 | Ep_massique=-self.masse_astre*self.G/self.distance_astre | |
239 | Em_massique=Ec_massique+Ep_massique | |
240 | if Em_massique >= 0: | |
241 | self.debug(1,"L'énergie mécanique est excessive (%s J/kg), la trajectoire ne se fermera pas" %Em_massique) | |
242 | t=QApplication.translate("MainWindow", "Ce n'est pas un satellite", None, QApplication.UnicodeUTF8) | |
243 | q=QApplication.translate("MainWindow", "L'énergie mécanique initiale est positive, l'objet lancé échappera à l'attraction de l'astre. Voulez-vous tracer une partie de la trajectoire ?", None, QApplication.UnicodeUTF8) | |
244 | ret=QMessageBox.question (self, t, q, 1, 2) | |
245 | if ret==1: | |
246 | self.t=30*(self.distance_astre**3/self.masse_astre/self.G)**0.5 | |
247 | self.dt=self.t/100 | |
248 | else: | |
249 | raise(ValueError) | |
250 | else: | |
251 | # calcul du grand axe a : Em = -k/2a pour une trajectoire elliptique | |
252 | # donc a = -k/2Em | |
253 | a = - self.masse_astre*self.G/2/Em_massique | |
254 | ||
255 | # calcul de la période, en utilisant la troisième loi de Kepler | |
256 | # T²=4pi²/MG*a³ | |
257 | self.t = 2*pi*(a**3/self.masse_astre/self.G)**0.5 | |
258 | self.dt = self.t/1000 | |
259 | self.debug(5,"masse astre %s" %self.masse_astre) | |
260 | self.gAstre = nouvChampGrav((0,0,0),self.masse_astre) | |
261 | self.pos = (0.0, self.distance_astre, 0) | |
262 | self.vit = (self.vitesse_x,self.vitesse_y,0.0) | |
263 | ||
264 | ||
265 | def dessine_trajectoire(self): | |
266 | ||
267 | self.debug(9,"dessine la trajectoire") | |
268 | self.dessine(self.traj.pv) | |
269 | # on teste si toute la trajectoire tien bien là. | |
270 | r=self.maxDistance(self.traj.pv) | |
271 | if not self.surementVisible(r) and not self.boum > 0: | |
272 | t=QApplication.translate("MainWindow", "Changement d'échelle", None, QApplication.UnicodeUTF8) | |
273 | q=QApplication.translate("MainWindow", "Un dépassement a été détecté. Voulez-vous changer d'échelle ?", None, QApplication.UnicodeUTF8) | |
274 | ret=QMessageBox.question (self, t, q, 1, 2) | |
275 | if ret==1: | |
276 | self.setEchelle(r,"max") | |
277 | self.efface() | |
278 | self.dessine(self.traj.pv) | |
279 | ||
280 | def maxDistance(self,points_vitesses): | |
281 | """renvoie la distance max entre le centre et le satellite en | |
282 | projection sur le plan xy. | |
283 | """ | |
284 | r=0 | |
285 | for pv in points_vitesses: | |
286 | if fabs(pv[0])>r: r=fabs(pv[0]) | |
287 | if fabs(pv[1])>r: r=fabs(pv[1]) | |
288 | return r | |
289 | ||
290 | ||
291 | def surementVisible(self,r): | |
292 | """vrai si un cercle de rayon r est visible à coup sûr""" | |
293 | return r/self.echelle < self.milieuY | |
294 | ||
295 | def efface(self): | |
296 | for k in self.points.keys(): | |
297 | objet=self.points[k] | |
298 | objet.hide() | |
299 | objet.clear() | |
300 | self.points = {} | |
301 | self.vitesse = [] | |
302 | ||
303 | def trace_point(self, x, y, couleur, type="petit", tau=None): | |
304 | if tau: | |
305 | cle=(x,y,tau) | |
306 | else: | |
307 | cle=(x,y) | |
308 | if cle in self.points.keys(): | |
309 | # efface des points préexistants de même emplacement | |
310 | objet=self.points[cle] | |
311 | objet.hide() | |
312 | objet.clear() | |
313 | self.points[cle]=Point(self, (x,y), couleur, "", self.mainWin,type_de_point=type) | |
314 | self.points[cle].show() | |
315 | ||
316 | ||
317 | def dessine(self,points_vitesses): | |
318 | self.boum=-1.0 | |
319 | OKtau=False | |
320 | intervalle=self.mainWin.ui.intervale.text() | |
321 | self.tau = int(flottant.traduit(intervalle)) | |
322 | if self.tau > 60: OKtau=True | |
323 | ||
324 | self.vitesse = [] | |
325 | self.date=[] | |
326 | tau_entier = 0 | |
327 | for i in range(0,len(points_vitesses),10): | |
328 | # on ne trace qu'un point sur 10, soit 100 points | |
329 | # sur les 1000 calculés | |
330 | pv=points_vitesses[i] | |
331 | pix_x=int(pv[0]/self.echelle+self.milieuX) | |
332 | pix_y=int(-pv[1]/self.echelle+self.milieuY) | |
333 | ||
334 | # pv est un hexuplet : 3 coordonnées de position, 3 de vitesse | |
335 | self.vitesse.append((pv[3],pv[4])) | |
336 | self.date.append(self.dt*i) | |
337 | if ((pix_x-self.milieuX)**2+(pix_y-self.milieuY)**2)**(0.5) < int(self.mainWin.getRayonAstre()/self.echelle) : | |
338 | self.trace_point(pix_x, pix_y, "red", type="boum") | |
339 | self.boum=self.dt*i | |
340 | break | |
341 | else: | |
342 | self.trace_point(pix_x, pix_y, "red") | |
343 | ||
344 | if OKtau: | |
345 | try : | |
346 | #dessine un point tous les "tau" secondes si défini. | |
347 | tau = i*self.dt/self.tau | |
348 | ||
349 | if int(tau) > int(tau_entier) : | |
350 | self.trace_point(pix_x, pix_y, "blue", type="gros", tau=tau) | |
351 | tau_entier=int(tau) | |
352 | except AttributeError: | |
353 | pass | |
354 | self.repaint() | |
355 | self.update() | |
356 | ||
357 | def paintEvent(self, event): | |
358 | painter = QPainter() | |
359 | painter.begin(self) | |
360 | painter.setBrush(Qt.CrossPattern) | |
361 | painter.setPen(Qt.green) | |
362 | ||
363 | rayon=int(self.mainWin.getRayonAstre()/self.echelle) | |
364 | painter.drawLine(self.milieuX, 0, self.milieuX, self.milieuY*2) | |
365 | painter.drawLine(0,self.milieuY , 2*self.milieuX, self.milieuY) | |
366 | img=self.astreImg | |
367 | sourcerect=QRect(0,0,512,512) | |
368 | self.milieuX=self.size().width()/2 | |
369 | self.milieuY=self.size().height()/2 | |
370 | targetrect=QRect(self.milieuX-rayon,self.milieuY-rayon,2*rayon,2*rayon) | |
371 | #TODO : il faudrait redessiner le rectangle en fonction de l'échelle | |
372 | #TODO : la taille n'est pas bien calculée quand on redimensionne !!! | |
373 | painter.drawEllipse(targetrect) | |
374 | painter.drawImage(targetrect,img,sourcerect) | |
375 | painter.end() | |
376 | ||
377 | def dir(self,choix): | |
378 | return self.rep.chemin(choix) | |
379 | ||
380 | def debug(self,level,msg): | |
381 | self.mainWin.debug(level,msg) | |
382 | ||
383 | def getPlanete(self,nom): | |
384 | if nom not in self.planetes.keys(): | |
385 | handle, imageFile = tempfile.mkstemp(".png") | |
386 | os.close(handle) | |
387 | cmd="xplanet -latitude 90 -num_times 1 -glare 10 -body %s -radius 50 -searchdir %s -transpng %s -rotate -70" %(nom,self.dir("textures"),imageFile) | |
388 | # la rotation de -70° permet au méridiens français de se trouver | |
389 | # au centre de l'image. Cette valeur est empirique et dépend | |
390 | # probablement de l'implémentation de Xplanet. Il n'est pas | |
391 | # évident de jouer avec l'option -north qui seule permet de | |
392 | # contrôler totalement l'orientation de l'image. | |
393 | self.debug(8,"Création de l'image de planète par \"%s\"" %cmd) | |
394 | os.system(cmd) | |
395 | self.planetes[nom]=QImage(imageFile) | |
396 | os.system("rm -f %s" %imageFile) | |
397 | return self.planetes[nom] | |
398 | ||
399 | def choisi_astre(self,nom): | |
400 | self.astreImg= self.getPlanete(nom) | |
401 | ||
402 | ||
403 | class Satellite(QLabel): | |
404 | def __init__(self, parent, coord_sat, image): | |
405 | QLabel.__init__(self, parent) | |
406 | self.parent = parent | |
407 | self.coord_sat=coord_sat | |
408 | self.image = image | |
409 | def paintEvent(self, event): | |
410 | painter = QPainter() | |
411 | painter.setBrush(Qt.CrossPattern) | |
412 | painter.setPen(Qt.green) | |
413 | painter.begin(self) | |
414 | x, y = self.coord_sat.x(), self.coord_sat.y() | |
415 | self.debug(5,"%s,%s" %(x,y)) | |
416 | painter.drawEllipse(x,y,30,16) | |
417 | painter.drawPixmap(self.coord_sat, self.image) | |
418 | painter.end() | |
419 |
0 | # -*- coding: utf-8 -*- | |
1 | ||
2 | """ | |
3 | video.py est un module permettant de faire un fichier video à partir d'un | |
4 | tableau de positions-vitesses tel que pysatellite peut le réaliser. | |
5 | """ | |
6 | ||
7 | import math, datetime, tempfile, os.path, os | |
8 | from astres import Astre | |
9 | from PyQt4.QtGui import * | |
10 | from threading import * | |
11 | from debug import Debug | |
12 | import flottant as flottant | |
13 | ||
14 | class Cinema(Thread): | |
15 | def __init__(self,repertoire, astre, dateorigine, liste_temps, liste_pos, geometrie, pas=1, nettoie=True, boum=-1.0, debugger=Debug(0)): | |
16 | Thread.__init__(self) | |
17 | self.repertoire=repertoire | |
18 | self.astre=astre | |
19 | self.dateorigine=dateorigine | |
20 | self.liste_temps=liste_temps | |
21 | self.liste_pos=liste_pos | |
22 | self.geometrie=geometrie | |
23 | self.pas=pas | |
24 | self.nettoie=nettoie | |
25 | self.boum=boum | |
26 | self.dir=tempfile.mkdtemp("","pysat") | |
27 | self.fini=False | |
28 | self.nbImage=0 | |
29 | self.debug=debugger | |
30 | ||
31 | def run(self): | |
32 | self.video() | |
33 | os.system("vlc --loop %s > /dev/null 2>&1" %os.path.join(self.dir,"out.avi")) | |
34 | if self.nettoie: os.system("rm -r %s" %self.dir) | |
35 | ||
36 | def video(self): | |
37 | self.images() | |
38 | cmd="ffmpeg -r 25 -f image2 -i %s -f avi -vcodec mpeg1video -b 800k %s > /dev/null 2>&1" %(os.path.join(self.dir, "%04d.jpg"), os.path.join(self.dir, "out.avi")) | |
39 | os.system(cmd) | |
40 | ||
41 | def images(self): | |
42 | listenum= range(0, len(self.liste_temps), self.pas) | |
43 | for i in listenum: | |
44 | if self.fini: | |
45 | return | |
46 | temps=self.liste_temps[i] | |
47 | if self.boum > 0 and temps > self.boum: | |
48 | self.imageCrash(self.nbImage) | |
49 | self.fini=True | |
50 | return | |
51 | x=self.liste_pos[i][0] | |
52 | y=self.liste_pos[i][1] | |
53 | z=self.liste_pos[i][2] | |
54 | cmd=self.xplanetCmd(temps, x, y, z, | |
55 | os.path.join(self.dir, "%04d.jpg" %self.nbImage)) | |
56 | os.system(cmd) | |
57 | self.nbImage+=1 | |
58 | ||
59 | def imageCrash(self,num): | |
60 | for n in range(20): | |
61 | nomfichier=os.path.join(self.dir, "%04d.jpg" %(num+n)) | |
62 | (w,h)=self.geometrie.split("x") | |
63 | img=QImage(int(w), int(h), QImage.Format_RGB32) | |
64 | img.fill(QColor("red").rgb()) | |
65 | img.save(nomfichier) | |
66 | ||
67 | def xplanetCmd(self,temps, x, y, z, nomfichier): | |
68 | """ | |
69 | dateorigine est un objet datetime fixe, | |
70 | temps est une durée en seconde | |
71 | """ | |
72 | a=Astre(self.astre) | |
73 | td=datetime.timedelta(seconds=temps) | |
74 | date=self.dateorigine+td | |
75 | dateXplanet=date.strftime("%Y%m%d.%H%M%S") | |
76 | ||
77 | rayon=1.0*(x**2+y**2+z**2)**0.5 | |
78 | range=rayon/a.rayon | |
79 | if range > 1.0: | |
80 | radius=100*math.asin(1.0/range) | |
81 | else: | |
82 | radius=9000 | |
83 | longitude0=360.0*temps/(24*3600*flottant.traduit(a.rotationSiderale)) | |
84 | longitude=180/math.pi*math.atan2(y,x)-90 | |
85 | latitude=180/math.pi*math.atan2(z,(x**2+y**2)**0.5) | |
86 | cmd="xplanet -date %s -radius %s -num_times 1 -output '%s' -geometry %s -origin %s -range %s -longitude %s -latitude %s -starmap BSC -searchdir %s -body %s -label >/dev/null 2>&1" %(dateXplanet, radius, nomfichier, self.geometrie, self.astre, range, int(a.flip)*(longitude-longitude0), latitude, self.repertoire.chemin("textures"), self.astre) | |
87 | self.debug(4,u"Lancemende de «%s»" %cmd) | |
88 | return cmd | |
89 |