Fixups for ca server

Add very preliminary client for ca and TDE
master
Timothy Pearson 12 years ago
parent f8d3727794
commit 408e828f47

@ -0,0 +1 @@
Timothy Pearson <kb9vqf@pearsoncomputing.net>

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

@ -0,0 +1,397 @@
GNU Free Documentation License
Version 1.2, November 2002
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
1. APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The "Document", below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as "you". You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject. (Thus, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML, PostScript or PDF designed for human modification. Examples of
transparent image formats include PNG, XCF and JPG. Opaque formats
include proprietary formats that can be read and edited only by
proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
A section "Entitled XYZ" means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as "Acknowledgements",
"Dedications", "Endorsements", or "History".) To "Preserve the Title"
of such a section when you modify the Document means that it remains a
section "Entitled XYZ" according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
3. COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled "History", Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled "History" in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the "History" section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
K. For any section Entitled "Acknowledgements" or "Dedications",
Preserve the Title of the section, and preserve in the section all
the substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
M. Delete any section Entitled "Endorsements". Such a section
may not be included in the Modified Version.
N. Do not retitle any existing section to be Entitled "Endorsements"
or to conflict in title with any Invariant Section.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled "History"
in the various original documents, forming one section Entitled
"History"; likewise combine any sections Entitled "Acknowledgements",
and any sections Entitled "Dedications". You must delete all sections
Entitled "Endorsements".
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an "aggregate" if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the "with...Texts." line with this:
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.

@ -0,0 +1,8 @@
SUBDIRS = src misc doc po
messages: rc.cpp
$(EXTRACTRC) `find . -name "*.rc" -o -name "*.ui"` >> rc.cpp
LIST=`find src -name \*.h -o -name \*.cpp` ;\
if test -n "$$LIST"; then \
$(XGETTEXT) rc.cpp $$LIST -o $(podir)/filelight.pot; \
fi

@ -0,0 +1,14 @@
all:
@echo "This Makefile is only for the CVS repository"
@echo "This will be deleted before making the distribution"
@echo ""
@if test ! -d admin; then \
echo "Please recheckout this module!" ;\
echo "for cvs: use checkout once and after that update again" ;\
echo "for cvsup: checkout kde-common from cvsup and" ;\
echo " link kde-common/admin to ./admin" ;\
exit 1 ;\
fi
$(MAKE) -f admin/Makefile.common cvs
.SILENT:

@ -0,0 +1,28 @@
1.3
features for sysadmins, split by users etc.
1.2
split rendering engine from data-gatherer and allow data to be fed through a pipe thus allowing different data sources to be profiled.
show preview icons next to the labels
last access time colour scheme
History actions need to have menu pulldown just like konqi
show statusbar signal to say that diretories weren't scanned due to lack of permissions (allow user to enter root password, for this scan only or to keep and then scan only bits that were missed)
determine if canvas is too square and shrink map accordingly
1.1
If scanning a partition show free space
if the view is square shrink the map slightly as a slightly rectangular view is preferable
use kdirwatcher, then move rescan to scan menu, rename force rescan
clicking center goes up directory
refactor disklister.cpp
implement vectors instead of double-linked lists for file data
Trace inodes in binarytree to avoid recursive hardlinks and counting same directory tree twice
admin mode
fix that Part settings file is not same as app settings file
support other mouse actions for central circle (ie middle click, right click)
write caches for all scans, so if crash or something that root scan that took 20 mins is not lost
MAYBE
flicking mouse wheel shows different information in tooltip, and there's an off setting, show temp status message to reflect info box
ideally, eventually show which labels are children of which by grouping them with a coloured square or something
create html summary files (pics and text)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,262 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD
/* Define to 1 if you have the <Carbon/Carbon.h> header file. */
#undef HAVE_CARBON_CARBON_H
/* Define if you have the CoreAudio API */
#undef HAVE_COREAUDIO
/* Define to 1 if you have the <crt_externs.h> header file. */
#undef HAVE_CRT_EXTERNS_H
/* Defines if your system has the crypt function */
#undef HAVE_CRYPT
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if you have libjpeg */
#undef HAVE_LIBJPEG
/* Define if you have libpng */
#undef HAVE_LIBPNG
/* Define if you have a working libpthread (will enable threaded code) */
#undef HAVE_LIBPTHREAD
/* Define if you have libz */
#undef HAVE_LIBZ
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define if your system needs _NSGetEnviron to set up the environment */
#undef HAVE_NSGETENVIRON
/* Define if you have res_init */
#undef HAVE_RES_INIT
/* Define if you have the res_init prototype */
#undef HAVE_RES_INIT_PROTO
/* Define if you have a STL implementation by SGI */
#undef HAVE_SGI_STL
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have strlcat */
#undef HAVE_STRLCAT
/* Define if you have the strlcat prototype */
#undef HAVE_STRLCAT_PROTO
/* Define if you have strlcpy */
#undef HAVE_STRLCPY
/* Define if you have the strlcpy prototype */
#undef HAVE_STRLCPY_PROTO
/* Define to 1 if you have the <sys/bitypes.h> header file. */
#undef HAVE_SYS_BITYPES_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* Suffix for lib directories */
#undef KDELIBSUFF
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of `char *', as computed by sizeof. */
#undef SIZEOF_CHAR_P
/* The size of `int', as computed by sizeof. */
#undef SIZEOF_INT
/* The size of `long', as computed by sizeof. */
#undef SIZEOF_LONG
/* The size of `short', as computed by sizeof. */
#undef SIZEOF_SHORT
/* The size of `size_t', as computed by sizeof. */
#undef SIZEOF_SIZE_T
/* The size of `unsigned long', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_LONG
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* If we use arts volume */
#undef USE_ARTS
/* Version number of package */
#undef VERSION
/* Defined if compiling without arts */
#undef WITHOUT_ARTS
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
# undef WORDS_BIGENDIAN
# endif
#endif
/*
* jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
* headers and I'm too lazy to write a configure test as long as only
* unixware is related
*/
#ifdef _UNIXWARE
#define HAVE_BOOLEAN
#endif
/*
* AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
* that defines bzero.
*/
#if defined(_AIX)
#include <strings.h>
#endif
#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
# include <sys/time.h>
# include <crt_externs.h>
# define environ (*_NSGetEnviron())
#endif
#if !defined(HAVE_RES_INIT_PROTO)
#ifdef __cplusplus
extern "C" {
#endif
int res_init(void);
#ifdef __cplusplus
}
#endif
#endif
#if !defined(HAVE_STRLCAT_PROTO)
#ifdef __cplusplus
extern "C" {
#endif
unsigned long strlcat(char*, const char*, unsigned long);
#ifdef __cplusplus
}
#endif
#endif
#if !defined(HAVE_STRLCPY_PROTO)
#ifdef __cplusplus
extern "C" {
#endif
unsigned long strlcpy(char*, const char*, unsigned long);
#ifdef __cplusplus
}
#endif
#endif
/*
* On HP-UX, the declaration of vsnprintf() is needed every time !
*/
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
#if __STDC__
#include <stdarg.h>
#include <stdlib.h>
#else
#include <varargs.h>
#endif
#ifdef __cplusplus
extern "C"
#endif
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
#ifdef __cplusplus
extern "C"
#endif
int snprintf(char *str, size_t n, char const *fmt, ...);
#endif
#if defined(__SVR4) && !defined(__svr4__)
#define __svr4__ 1
#endif
/* type to use in place of socklen_t if not defined */
#undef kde_socklen_t
/* type to use in place of socklen_t if not defined (deprecated, use
kde_socklen_t) */
#undef ksize_t

File diff suppressed because it is too large Load Diff

28333
clients/tde/configure vendored

File diff suppressed because it is too large Load Diff

@ -0,0 +1,2 @@
./admin/configure.in.min
configure.in.in

@ -0,0 +1,135 @@
dnl =======================================================
dnl FILE: ./admin/configure.in.min
dnl =======================================================
dnl This file is part of the KDE libraries/packages
dnl Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
dnl This file is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Library General Public
dnl License as published by the Free Software Foundation; either
dnl version 2 of the License, or (at your option) any later version.
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Library General Public License for more details.
dnl You should have received a copy of the GNU Library General Public License
dnl along with this library; see the file COPYING.LIB. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
dnl Boston, MA 02110-1301, USA.
# Original Author was Kalle@kde.org
# I lifted it in some mater. (Stephan Kulow)
# I used much code from Janos Farkas
dnl Process this file with autoconf to produce a configure script.
AC_INIT(acinclude.m4) dnl a source file from your sub dir
dnl This is so we can use kde-common
AC_CONFIG_AUX_DIR(admin)
dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
unset CDPATH
dnl Checking host/target/build systems, for make, install etc.
AC_CANONICAL_SYSTEM
dnl Perform program name transformation
AC_ARG_PROGRAM
dnl Automake doc recommends to do this only here. (Janos)
AM_INIT_AUTOMAKE(tde, "3.5.10") dnl searches for some needed programs
KDE_SET_PREFIX
dnl generate the config header
AM_CONFIG_HEADER(config.h) dnl at the distribution this done
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_CHECK_COMPILERS
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
KDE_PROG_LIBTOOL
dnl for NLS support. Call them in this order!
dnl WITH_NLS is for the po files
AM_KDE_WITH_NLS
KDE_USE_QT(3.2)
AC_PATH_KDE
dnl =======================================================
dnl FILE: configure.in.in
dnl =======================================================
#MIN_CONFIG(3.2)
CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"
if test "$build_arts" = "yes"; then
AC_DEFINE(USE_ARTS, 1, [If we use arts volume])
LIB_ARTS="-lartskde"
AC_SUBST(LIB_ARTS)
fi
KDE_INIT_DOXYGEN([The API Reference], [Version $VERSION])
KDE_CREATE_SUBDIRSLIST
AC_CONFIG_FILES([ Makefile ])
AC_CONFIG_FILES([ doc/Makefile ])
AC_CONFIG_FILES([ misc/Makefile ])
AC_CONFIG_FILES([ po/Makefile ])
AC_CONFIG_FILES([ src/Makefile ])
AC_CONFIG_FILES([ src/app/Makefile ])
AC_CONFIG_FILES([ src/app/views/Makefile ])
AC_CONFIG_FILES([ src/part/Makefile ])
AC_CONFIG_FILES([ src/part/commanalyzer/Makefile ])
AC_CONFIG_FILES([ src/widgets/Makefile ])
AC_OUTPUT
# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
# And if so, warn when they don't match
if test "$kde_libs_prefix" != "$given_prefix"; then
# And if kde doesn't know about the prefix yet
echo ":"`tde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
if test $? -ne 0; then
echo ""
echo "Warning: you chose to install this package in $given_prefix,"
echo "but KDE was found in $kde_libs_prefix."
echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
echo "that TDEDIRS contains it, e.g. export TDEDIRS=$given_prefix:$kde_libs_prefix"
echo "Then restart KDE."
echo ""
fi
fi
fi
if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then
echo ""
echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility"
echo "was not included. Therefore, GCC symbol visibility support remains disabled."
echo ""
echo "For better performance, consider including the Qt visibility supporting patch"
echo "located at:"
echo ""
echo "http://bugs.kde.org/show_bug.cgi?id=109386"
echo ""
echo "and recompile all of Qt and KDE. Note, this is entirely optional and"
echo "everything will continue to work just fine without it."
echo ""
fi
if test "$all_tests" = "bad"; then
if test ! "$cache_file" = "/dev/null"; then
echo ""
echo "Please remove the file $cache_file after changing your setup"
echo "so that configure will find the changes next time."
echo ""
fi
else
echo ""
echo "Good - your configure finished. Start make now"
echo ""
fi

@ -0,0 +1,11 @@
#MIN_CONFIG(3.2)
CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"
if test "$build_arts" = "yes"; then
AC_DEFINE(USE_ARTS, 1, [If we use arts volume])
LIB_ARTS="-lartskde"
AC_SUBST(LIB_ARTS)
fi
KDE_INIT_DOXYGEN([The API Reference], [Version $VERSION])

@ -0,0 +1,86 @@
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2002,2003 Colin Walters <walters@debian.org>
# Description: Defines some useful variables, but no rules
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA.
_cdbs_scripts_path ?= /usr/lib/cdbs
_cdbs_rules_path ?= /usr/share/cdbs/1/rules
_cdbs_class_path ?= /usr/share/cdbs/1/class
ifndef _cdbs_rules_buildvars
_cdbs_rules_buildvars = 1
CDBS_VERSION = something
# Common useful variables
DEB_SOURCE_PACKAGE := $(strip $(shell egrep '^Source: ' debian/control | cut -f 2 -d ':'))
DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
DEB_NOEPOCH_VERSION := $(shell echo $(DEB_VERSION) | cut -d: -f2-)
DEB_UPSTREAM_VERSION := $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//')
DEB_ISNATIVE := $(shell dpkg-parsechangelog | egrep '^Version:' | perl -ne 'print if not /^Version:\s*.*-/;')
# Split into arch/indep packages
ifneq ($(DEB_INDEP_PACKAGES),cdbs)
DEB_INDEP_PACKAGES := $(filter-out $(DONT_BUILD), $(strip $(shell $(_cdbs_scripts_path)/list-packages indep)))
DEB_ARCH_PACKAGES := $(filter-out $(DONT_BUILD), $(filter-out $(DEB_INDEP_PACKAGES),$(strip $(shell $(_cdbs_scripts_path)/list-packages same))))
endif
# Split into normal and udeb packages
ifeq ($(DEB_UDEB_PACKAGES),)
DEB_PACKAGES = $(filter-out $(DONT_BUILD), $(filter-out %-udeb, $(DEB_ARCH_PACKAGES) $(DEB_INDEP_PACKAGES)))
DEB_UDEB_PACKAGES = $(filter-out $(DONT_BUILD),$(filter %-udeb, $(DEB_ARCH_PACKAGES) $(DEB_INDEP_PACKAGES)))
else
DEB_PACKAGES = $(filter-out $(DONT_BUILD), $(filter-out $(DEB_UDEB_PACKAGES), $(DEB_ARCH_PACKAGES) $(DEB_INDEP_PACKAGES)))
endif
# Too much bother for now. If someone complains we'll fix it.
#DEB_ARCH_UDEB_PACKAGES = $(filter %-udeb, $(DEB_ARCH_PACKAGES))
#DEB_INDEP_UDEB_PACKAGES = $(filter %-udeb, $(DEB_INDEP_PACKAGES))
# A handy list of every package, udeb or not
DEB_ALL_PACKAGES = $(filter-out $(DONT_BUILD),$(DEB_PACKAGES) $(DEB_UDEB_PACKAGES))
DEB_INDEP_REGULAR_PACKAGES = $(filter-out $(DONT_BUILD), $(filter-out $(DEB_UDEB_PACKAGES),$(DEB_INDEP_PACKAGES)))
DEB_ARCH_REGULAR_PACKAGES = $(filter-out $(DONT_BUILD), $(filter-out $(DEB_UDEB_PACKAGES),$(DEB_ARCH_PACKAGES)))
DEB_DBG_PACKAGES = $(filter-out $(DONT_BUILD), $(filter %-dbg, $(DEB_ARCH_PACKAGES) $(DEB_INDEP_PACKAGES)))
# Some support for srcdir != builddir builds.
# These are relative to the root of the package
DEB_SRCDIR ?= .
DEB_BUILDDIR ?= $(strip $(DEB_SRCDIR))
# Miscellaneous bits
DEB_ARCH = $(shell dpkg --print-architecture)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_HOST_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_BUILD_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
DEB_BUILD_GNU_CPU ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
DEB_BUILD_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)
DEB_BUILD_ARCH_OS ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
ifeq ($(words $(DEB_ALL_PACKAGES)),1)
DEB_DESTDIR = $(CURDIR)/debian/$(strip $(DEB_ALL_PACKAGES))/
else
DEB_DESTDIR = $(CURDIR)/debian/tmp/
endif
CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), cdbs (>= 0.4.23-1.1)
endif

@ -0,0 +1,109 @@
ifndef _cdbs_bootstrap
_cdbs_scripts_path ?= /usr/lib/cdbs
_cdbs_rules_path ?= /usr/share/cdbs/1/rules
_cdbs_class_path ?= /usr/share/cdbs/1/class
endif
ifndef _cdbs_class_debian-qt-kde
_cdbs_class_debian-qt-kde := 1
# Note: This _must_ be included before autotools.mk, or it won't work.
common-configure-arch common-configure-indep:: debian/stamp-cvs-make
debian/stamp-cvs-make:
cp -Rp /usr/share/aclocal/libtool.m4 admin/libtool.m4.in
cp -Rp /usr/share/libtool/config/ltmain.sh admin/ltmain.sh
$(MAKE) -C $(DEB_SRCDIR) -f admin/Makefile.common dist;
touch debian/stamp-cvs-make
include debian/cdbs/kde.mk$(_cdbs_makefile_suffix)
include debian/cdbs/uploaders.mk
DEB_PATCHDIRS := debian/patches/common debian/patches
DEB_KDE_ENABLE_FINAL := yes
DEB_INSTALL_DOCS_ALL :=
DEB_DH_MAKESHLIBS_ARGS_ALL := -V
DEB_SHLIBDEPS_INCLUDE = $(foreach p,$(PACKAGES_WITH_LIBS),debian/$(p)/usr/lib)
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
cdbs_treat_me_gently_arches := arm m68k alpha ppc64 armel armeb
ifeq (,$(filter $(DEB_HOST_ARCH_CPU),$(cdbs_treat_me_gently_arches)))
cdbs_kde_enable_final = $(if $(DEB_KDE_ENABLE_FINAL),--enable-final,)
else
cdbs_kde_enable_final =
endif
endif
common-build-arch:: debian/stamp-man-pages
debian/stamp-man-pages:
if ! test -d debian/man/out; then mkdir -p debian/man/out; fi
for f in $$(find debian/man -name '*.sgml'); do \
docbook-to-man $$f > debian/man/out/`basename $$f .sgml`.1; \
done
for f in $$(find debian/man -name '*.man'); do \
soelim -I debian/man $$f \
> debian/man/out/`basename $$f .man`.`head -n1 $$f | awk '{print $$NF}'`; \
done
touch debian/stamp-man-pages
common-binary-indep::
( set -e; \
tmpf=`mktemp debian/versions.XXXXXX`; \
perl debian/cdbs/versions.pl >$$tmpf; \
for p in $(DEB_INDEP_PACKAGES); do \
cat $$tmpf >>debian/$$p.substvars; \
done; \
rm -f $$tmpf )
common-binary-arch::
( set -e; \
tmpf=`mktemp debian/versions.XXXXXX`; \
perl debian/cdbs/versions.pl >$$tmpf; \
for p in $(DEB_ARCH_PACKAGES); do \
cat $$tmpf >>debian/$$p.substvars; \
done; \
rm -f $$tmpf )
clean::
rm -rf debian/man/out
-rmdir debian/man
rm -f debian/stamp-man-pages
rm -rf debian/shlibs-check
$(patsubst %,binary-install/%,$(DEB_PACKAGES)) :: binary-install/%:
if test -x /usr/bin/dh_desktop; then dh_desktop -p$(cdbs_curpkg) $(DEB_DH_DESKTOP_ARGS); fi
if test -e debian/$(cdbs_curpkg).lintian; then \
install -p -D -m644 debian/$(cdbs_curpkg).lintian \
debian/$(cdbs_curpkg)/usr/share/lintian/overrides/$(cdbs_curpkg); \
fi
if test -e debian/$(cdbs_curpkg).presubj; then \
install -p -D -m644 debian/$(cdbs_curpkg).presubj \
debian/$(cdbs_curpkg)/usr/share/bug/$(cdbs_curpkg)/presubj; \
fi
binary-install/$(DEB_SOURCE_PACKAGE)-doc-html::
set -e; \
for doc in `cd $(DEB_DESTDIR)/opt/trinity/share/doc/tde/HTML/en; find . -name index.docbook`; do \
pkg=$${doc%/index.docbook}; pkg=$${pkg#./}; \
echo Building $$pkg HTML docs...; \
mkdir -p $(CURDIR)/debian/$(DEB_SOURCE_PACKAGE)-doc-html/opt/trinity/share/doc/tde/HTML/en/$$pkg; \
cd $(CURDIR)/debian/$(DEB_SOURCE_PACKAGE)-doc-html/opt/trinity/share/doc/tde/HTML/en/$$pkg; \
/opt/trinity/bin/meinproc $(DEB_DESTDIR)/opt/trinity/share/doc/tde/HTML/en/$$pkg/index.docbook; \
done
for pkg in $(DOC_HTML_PRUNE) ; do \
rm -rf debian/$(DEB_SOURCE_PACKAGE)-doc-html/opt/trinity/share/doc/tde/HTML/en/$$pkg; \
done
clean::
if test -n "$(DEB_KDE_CVS_MAKE)" && test -d $(DEB_SRCDIR); then \
cd $(DEB_SRCDIR); \
find . -name Makefile.in -print | \
xargs --no-run-if-empty rm -f; \
rm -f Makefile.am acinclude.m4 aclocal.m4 config.h.in \
configure configure.files configure.in stamp-h.in \
subdirs; \
fi
rm -f debian/stamp-cvs-make
endif

@ -0,0 +1,97 @@
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2003 Christopher L Cheney <ccheney@debian.org>
# Description: A class for KDE packages; sets KDE environment variables, etc
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA.
_cdbs_scripts_path ?= /usr/lib/cdbs
_cdbs_rules_path ?= /usr/share/cdbs/1/rules
_cdbs_class_path ?= /usr/share/cdbs/1/class
ifndef _cdbs_class_kde
_cdbs_class_kde := 1
# for dh_icons
CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), debhelper (>= 5.0.7ubuntu4)
include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
ifdef _cdbs_tarball_dir
DEB_BUILDDIR = $(_cdbs_tarball_dir)/obj-$(DEB_BUILD_GNU_TYPE)
else
DEB_BUILDDIR = obj-$(DEB_BUILD_GNU_TYPE)
endif
include $(_cdbs_class_path)/autotools.mk$(_cdbs_makefile_suffix)
export kde_cgidir = \$${libdir}/cgi-bin
export kde_confdir = \$${sysconfdir}/trinity
export kde_htmldir = \$${datadir}/doc/tde/HTML
ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
cdbs_kde_enable_final = $(if $(DEB_KDE_ENABLE_FINAL),--enable-final,)
endif
ifneq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
cdbs_kde_enable_final =
cdbs_kde_enable_debug = --enable-debug=yes
else
cdbs_kde_enable_debug = --disable-debug
endif
ifneq (,$(filter debug,$(DEB_BUILD_OPTIONS)))
cdbs_kde_enable_debug = --enable-debug=full
endif
cdbs_configure_flags += --with-qt-dir=/usr/share/qt3 --disable-rpath --with-xinerama $(cdbs_kde_enable_final) $(cdbs_kde_enable_debug)
DEB_AC_AUX_DIR = $(DEB_SRCDIR)/admin
DEB_CONFIGURE_INCLUDEDIR = "\$${prefix}/include/tde"
DEB_COMPRESS_EXCLUDE = .dcl .docbook -license .tag .sty .el
$(patsubst %,binary-install/%,$(DEB_PACKAGES)) :: binary-install/%:
if test -x /usr/bin/dh_icons; then dh_icons -p$(cdbs_curpkg) $(DEB_DH_ICONCACHE_ARGS); fi
cleanbuilddir::
-$(if $(call cdbs_streq,$(DEB_BUILDDIR),$(DEB_SRCDIR)),,rm -rf $(DEB_BUILDDIR))
common-build-arch common-build-indep:: debian/stamp-kde-apidox
debian/stamp-kde-apidox:
$(if $(DEB_KDE_APIDOX),+$(DEB_MAKE_INVOKE) apidox)
touch $@
common-install-prehook-impl::
mkdir -p po
-XGETTEXT=/usr/bin/kde-xgettext EXTRACTATTR=/opt/trinity/bin/extractattr sh $(DEB_SRCDIR)/admin/cvs.sh extract-messages
-for file in po/*pot; do \
sed "s/charset=CHARSET/charset=UTF-8/" -i $$file; \
done
common-install-arch common-install-indep:: common-install-kde-apidox
common-install-kde-apidox::
$(if $(DEB_KDE_APIDOX),+$(DEB_MAKE_INVOKE) install-apidox DESTDIR=$(DEB_DESTDIR))
clean::
rm -f debian/stamp-kde-apidox
rm -rf po/*.pot
# This is a convenience target for calling manually. It's not part of
# the build process.
buildprep: clean apply-patches
$(MAKE) -f admin/Makefile.common dist
debian/rules clean
endif

@ -0,0 +1,16 @@
Sune Vuorela <debian@pusling.com>
Ana Beatriz Guerrero Lopez <ana@debian.org>
Fathi Boudra <fboudra@free.fr>
Modestas Vainius <geromanas@mailas.com>
Josh Metzler <joshdeb@metzlers.org>
Isaac Clerencia <isaac@debian.org>
Adeodato Simó <dato@net.com.org.es>
Adeodato Simo <dato@net.com.org.es>
Christopher Martin <chrsmrtn@debian.org>
Daniel Schepler <schepler@debian.org>
Sarah Hobbs <hobbsee@ubuntu.com>
Nacho Barrientos Arias <nacho@debian.org>
Ricardo Javier Cardenes Medina <rcardenes@debian.org>
Ricardo Cardenes <rcardenes@debian.org>
Armin Berres <trigger+debian@space-based.de>
Francesco Pedrini <francesco.pedrini@gmail.com>

@ -0,0 +1,29 @@
MAINTAINER=Debian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
UPLOADERS=$(shell grep -e +++ -e "^ -- " debian/changelog | grep -v "debian-qt-kde@lists.debian.org" | head -13 | /bin/sed 's/^\s*//;s/\s*$$//;s/^+++\? Changes by //;s/^+++\? //;s/-- //;s/:$$//;s/ <.*//' | sort -u | while read line ; do grep "$$line" debian/cdbs/team-members ; done | tr "\n" ", " | sed 's/,/, /g;s/, $$//')
debian/control.tmp:
@if [ ! -e debian/control.in ] ; then \
echo "this package is not yet prepared for using automatic update of uploaders"; \
echo "Please do so."; \
exit 1; \
fi
@sed 's/@@@UPLOADERS@@@/$(UPLOADERS)/;s#@@@MAINTAINER@@@#$(MAINTAINER)#' debian/control.in > debian/control.tmp
check-uploaders: debian/control.tmp
@if ! diff -q debian/control debian/control.tmp ; then \
echo "WARNING:: Control file differs from manually generated one" ; \
echo "WARNING:: Please update it manually and check it afterwards" ; \
echo "WARNING:: Uploaders are updated by debian/rules update-uploaders" ;\
echo "WARNING:: If this is a binNMU, NMU or security upload, just ignore" ;\
fi
clean::
rm -f debian/control.tmp
update-uploaders: debian/control.tmp
@mv -f debian/control.tmp debian/control
makebuilddir:: check-uploaders

@ -0,0 +1,19 @@
#!/usr/bin/env perl
use strict;
use warnings;
my $version = `dpkg-parsechangelog | awk '/^Version/ {print \$2}'`;
my ($version3, $version3_next);
my ($version2, $version2_next);
($version3 = $version) =~ s/-[^-]+$//;
($version2 = $version3) =~ s/\.[^.]+$//;
($version3_next = $version3) =~ s/(?<=\.)(\d+)[a-z]?$/($1+1)/e;
($version2_next = $version2) =~ s/(?<=\.)(\d+)$/($1+1)/e;
print "KDE-Version3=$version3\n";
print "KDE-Version2=$version2\n";
print "KDE-Next-Version3=$version3_next\n";
print "KDE-Next-Version2=$version2_next\n";

@ -0,0 +1,6 @@
remote-laboratory-client-trinity (0.0.1-0ubuntu0) karmic; urgency=low
* Initial packaging
-- Timothy Pearson <kb9vqf@pearsoncomputing.net> Mon, 30 Apr 2012 16:41:00 -0600

@ -0,0 +1,15 @@
Source: remote-laboratory-client-trinity
Section: kde
Priority: optional
Maintainer: Timothy Pearson <kb9vqf@pearsoncomputing.net>
XSBC-Original-Maintainer: Debian KDE Extras Team <pkg-kde-extras@lists.alioth.debian.org>
Uploaders: Ral Snchez Siles <rasasi78@gmail.com>
Standards-Version: 3.8.4
Build-Depends: debhelper (>= 5.0), cdbs, tdelibs4-trinity-dev, xutils, chrpath, gettext, quilt (>= 0.40), automake, autoconf, libtool, libltdl-dev
Homepage: http://remotefpga.pearsoncomputing.net/
Package: remote-laboratory-client-trinity
Architecture: any
Depends: ${shlibs:Depends}
Description: remote laboratory client [Trinity]
Remote Laboratory Client for Trinity

@ -0,0 +1,6 @@
?package(remote_laboratory_client):needs="X11" \
section="Apps/Edutainment" \
hints="TDE" \
command="/opt/trinity/bin/remote_laboratory_client" \
title="Remote Laboratory Client" \
longtitle="Remote Laboratory Client: Do cool engineering things remotely"

@ -0,0 +1,37 @@
#!/usr/bin/make -f
# debian/rules file - for remote-laboratory-client (0.0.1)
# Copyright 2012 Timothy Pearson
# This packaging is licensed under GPLv2
# see /usr/share/common-licenses/GPL-2 for details.
include /usr/share/cdbs/1/rules/debhelper.mk
include debian/cdbs/kde.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
DEB_CONFIGURE_INCLUDEDIR := /opt/trinity/include/tde
DEB_CONFIGURE_MANDIR := /opt/trinity/share/man
DEB_CONFIGURE_PREFIX := /opt/trinity
DEB_CONFIGURE_INFODIR := /opt/trinity/share/info
cdbs_configure_flags := --with-qt-dir=/usr/share/tqt3 --disable-rpath --with-xinerama $(cdbs_kde_enable_final) $(cdbs_kde_enable_debug)
DEB_DH_ALWAYS_EXCLUDE=.svn
DEB_CONFIGURE_EXTRA_FLAGS := --prefix=/opt/trinity --with-extra-libs=/opt/trinity/lib --disable-debug
post-patches:: debian/stamp-bootstrap
debian/stamp-bootstrap:
! [ -f /usr/share/libtool/ltmain.sh ] || \
cp -f /usr/share/libtool/ltmain.sh admin/ltmain.sh
! [ -f /usr/share/libtool/config/ltmain.sh ] || \
cp -f /usr/share/libtool/config/ltmain.sh admin/ltmain.sh
cp -f /usr/share/aclocal/libtool.m4 admin/libtool.m4.in
make -f admin/Makefile.common cvs
touch debian/stamp-bootstrap
#get-orig-source-dpatch:
# @@dh_testdir
# @@[ -d ../tarballs/. ]
# @@dpatch-get-origtargz ../tarballs

@ -0,0 +1,6 @@
# Use bzip2 instead of gzip
compression = "bzip2"
compression-level = 9
# Don't run differences
diff-ignore = .*

@ -0,0 +1 @@
SUBDIRS = $(AUTODIRS)

@ -0,0 +1,12 @@
KDE_ICON = AUTO
rcdir = $(kde_datadir)/remote_laboratory_client
rc_DATA = remotelabui.rc
configdir = $(kde_confdir)
config_DATA =
xdg_apps_DATA = remote_laboratory_client.desktop
partdesktopdir = $(kde_servicesdir)
partdesktop_DATA =

@ -0,0 +1,13 @@
# KDE Config File
[Desktop Entry]
Encoding=UTF-8
Name=Remote Laboratory Client
Name[xx]=xxRemote Laboratory Clientxx
GenericName=Remote Laboratory Client
Type=Application
Exec=remote_laboratory_client
Icon=remote_laboratory_client.png
Comment=Remote laboratory client
Terminal=false
MimeType=inode/directory
Categories=Qt;KDE;Utility;

@ -0,0 +1,21 @@
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="remotelab" version="1">
<MenuBar>
<Menu name="MDIMode"><text>MDI Mode</text>
<Action name="toplevel" />
<Action name="childframe" />
<Action name="tabpage" />
<Action name="ideal" />
</Menu>
<Menu name="instrumentMenu"><text>Instrumentation</text>
<Action name="oscilloscope"/>
<Action name="frequency_generator"/>
<Action name="spectrum_analyzer"/>
</Menu>
</MenuBar>
<ToolBar name="instrumentToolBar" fullWidth="true" noMerge="1"><text>Instrumentation Toolbar</text>
<Action name="oscilloscope"/>
<Action name="frequency_generator"/>
<Action name="spectrum_analyzer"/>
</ToolBar>
</kpartgui>

@ -0,0 +1 @@
SUBDIRS = $(AUTODIRS)

@ -0,0 +1,13 @@
Begin3
title: Remote Laboratory Client
Version: 1.0
Entered-date: 4/28/2012
Description: Graphical remote laboratory client
Keywords: tde
author: Timothy Pearson <kb9vqf@pearsoncomputing.net>
Maintained-by: Timothy Pearson <kb9vqf@pearsoncomputing.net>
Home-page: http://remotefpga.pearsoncomputing.net/
Platform: unix
Copying-policy: GPL
End

@ -0,0 +1,3 @@
SUBDIRS = widgets app part
INCLUDES = $(all_includes)
METASOURCES = AUTO

@ -0,0 +1,9 @@
SUBDIRS = views
INCLUDES = $(all_includes) -I$(top_srcdir)/src
METASOURCES = AUTO
# Application
bin_PROGRAMS = remote_laboratory_client
remote_laboratory_client_SOURCES = main.cpp remotemdi.cpp
remote_laboratory_client_LDADD = ./views/libinstrumentview.la $(LIB_KPARTS) $(LIB_TDEUI)
remote_laboratory_client_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -lkmdi

@ -0,0 +1,61 @@
//Author: Timothy Pearson <kb9vqf@pearsoncomputing.net>, (C) 2012
//Copyright: See COPYING file that comes with this distribution
#include "define.h"
#include <kaboutdata.h>
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <klocale.h>
#include <kurl.h>
#include <kconfig.h>
#include "remotemdi.h"
static const KCmdLineOptions options[] =
{
{ "+[server]", I18N_NOOP( "Connect to remote server 'server'" ), 0 },
{ 0, 0, 0 }
};
static KAboutData about(
APP_NAME, I18N_NOOP( APP_PRETTYNAME ), APP_VERSION,
I18N_NOOP("Graphical remote laboratory client"), KAboutData::License_GPL_V2,
I18N_NOOP("(C) 2012 Timothy Pearson"), 0,
"http://remotefpga.pearsoncomputing.net/", "kb9vqf@pearsoncomputing.net" );
int main( int argc, char *argv[] )
{
about.addAuthor( "Timothy Pearson", I18N_NOOP("Author, maintainer"), "kb9vqf@pearsoncomputing.net", "http://remotefpga.pearsoncomputing.net/" );
KCmdLineArgs::init( argc, argv, &about );
KCmdLineArgs::addCmdLineOptions( options );
KApplication app;
// Read MDI mode
KConfig *c = app.config();
TQString strMode = c->readEntry("MDIMode", "ideal");
KMdi::MdiMode mode = KMdi::IDEAlMode;
if (strMode == "toplevel") {
mode = KMdi::ToplevelMode;
}
else if (strMode == "childframe") {
mode = KMdi::ChildframeMode;
}
else if (strMode == "tabpage") {
mode = KMdi::TabPageMode;
}
// Create main window
RemoteMDI *mainWin = new RemoteMDI(mode);
app.setMainWidget(mainWin);
KCmdLineArgs* const args = KCmdLineArgs::parsedArgs();
if (args->count() > 0) mainWin->setServerHost(args->arg(0));
args->clear();
mainWin->show();
// mainWin has WDestructiveClose flag by default, so it will delete itself.
return app.exec();
}

@ -0,0 +1,283 @@
//Author: Timothy Pearson <kb9vqf@pearsoncomputing.net>, (C) 2012
//Copyright: See COPYING file that comes with this distribution
// TDE MDI interface based on excellent tutorial by Andrea Bergia et al.
#include "remotemdi.h"
#include <cassert>
using namespace std;
#include <kapplication.h>
#include <klocale.h>
#include <kdebug.h>
#include <kconfig.h>
#include <tqlabel.h>
#include <tqtimer.h>
#include <tqlayout.h>
#include <kiconloader.h>
#include <kstdaction.h>
#include <kstatusbar.h>
#include <kmdichildview.h>
#include <klistbox.h>
#include <kactionclasses.h>
#include <kedittoolbar.h>
#include <kkeydialog.h>
#include "views/instrumentview.h"
RemoteMDI::RemoteMDI(KMdi::MdiMode mode)
: KMdiMainFrm(0, "RemoteMDI", mode), m_children(0)
{
setXMLFile("remotelabui.rc");
// Create some actions
KStdAction::openNew(this, SLOT(openNewWindow()), actionCollection());
KStdAction::close(this, SLOT(closeCurrent()), actionCollection());
KStdAction::quit(this, SLOT(close()), actionCollection());
// Allow the user to change the MDI mode
KToggleAction *tl = new KRadioAction(i18n("Top level mode"), KShortcut(), this, SLOT(switchToToplevelMode()), actionCollection(), "toplevel");
tl->setExclusiveGroup("MDIMode");
tl->setChecked(mode == KMdi::ToplevelMode);
KToggleAction *cf = new KRadioAction(i18n("Child frame mode"), KShortcut(), this, SLOT(switchToChildframeMode()), actionCollection(), "childframe");
cf->setExclusiveGroup("MDIMode");
cf->setChecked(mode == KMdi::ChildframeMode);
KToggleAction *tp = new KRadioAction(i18n("Tab page mode"), KShortcut(), this, SLOT(switchToTabPageMode()), actionCollection(), "tabpage");
tp->setExclusiveGroup("MDIMode");
tp->setChecked(mode == KMdi::TabPageMode);
KToggleAction *id = new KRadioAction( i18n("Ideal mode"), KShortcut(), this, SLOT(switchToIDEAlMode()), actionCollection(), "ideal");
id->setExclusiveGroup("MDIMode");
id->setChecked(mode == KMdi::IDEAlMode);
KToggleAction *inst_sa_menu = new KToggleAction(i18n("Spectrum Analyzer"), KShortcut(), this, SLOT(startSpectrumAnalyzer()), actionCollection(), "spectrum_analyzer");
KActionCollection *const ac = actionCollection();
setStandardToolBarMenuEnabled( true );
KStdAction::quit( TQT_TQOBJECT(this), TQT_SLOT(close()), ac );
KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(configToolbars()), ac);
KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(configKeys()), ac);
new KAction(i18n("Launch Spectrum Analyzer"), "remote", CTRL+Key_Home, TQT_TQOBJECT(this), TQT_SLOT(startSpectrumAnalyzer()), ac, "spectrum_analyzer" );
createGUI( 0 );
// When we change view, change the status bar text
connect(this, SIGNAL(viewActivated(KMdiChildView*)), this, SLOT(currentChanged(KMdiChildView*)));
// Create the status bar
statusBar()->message( i18n( "No view!" ) );
// Create the list of the opened windows
m_listBox = new KListBox( this );
m_listBox->setCaption( i18n( "Opened windows" ) );
addToolWindow( m_listBox, KDockWidget::DockLeft, getMainDockWidget() );
connect(m_listBox, SIGNAL(executed(TQListBoxItem *)), this, SLOT(listBoxExecuted(TQListBoxItem* )));
}
RemoteMDI::~RemoteMDI()
{
while (m_pCurrentWindow) {
closeCurrent();
}
}
void RemoteMDI::configToolbars() {
KEditToolbar dialog(factory(), this);
dialog.showButtonApply(false);
if (dialog.exec()) {
applyMainWindowSettings(kapp->config(), "window");
}
}
void RemoteMDI::configKeys() {
KKeyDialog::configure(actionCollection(), this);
}
void RemoteMDI::setServerHost(TQString server) {
m_serverHost = server;
}
void RemoteMDI::startSpectrumAnalyzer() {
RemoteLab::InstrumentView* saview = new RemoteLab::InstrumentView("libremotelab_commanalyzer", i18n("Communications Analyzer"), (mdiMode() == KMdi::ToplevelMode) ? 0 : this);
openNewWindow(saview);
if (m_serverHost != "") {
saview->connectServer(m_serverHost);
}
}
void RemoteMDI::openNewWindow(KMdiChildView *view)
{
// Add a child view
m_children++;
// The child view will be our child only if we aren't in Toplevel mode
if (!view) {
view = new KMdiChildView(i18n("View %1").arg(m_children), (mdiMode() == KMdi::ToplevelMode) ? 0 : this);
}
(new TQHBoxLayout(view))->setAutoAdd( true );
// Add the item to the window list
m_window.append(view);
m_listBox->insertItem(view->tabCaption());
// Add to the MDI and set as current
if (mdiMode() == KMdi::ToplevelMode) {
addWindow(view, KMdi::Detach);
}
else {
addWindow(view);
}
currentChanged(view);
// Handle termination
connect(view, SIGNAL(childWindowCloseRequest(KMdiChildView*)), this, SLOT(childClosed(KMdiChildView*)));
}
void RemoteMDI::childWindowCloseRequest(KMdiChildView *pWnd) {
RemoteLab::InstrumentView* iview = dynamic_cast<RemoteLab::InstrumentView*>(pWnd);
if (iview) {
iview->closeConnections();
iview->hide();
// Give the child a chance to finish what it was doing
// FIXME HACK
// There is no nice way to shut down the instrument parts it seems...
// Debug why they crash when this delay is set to zero!
m_closelist.append(pWnd);
TQTimer::singleShot(100, this, SLOT(processCloseList()));
}
}
void RemoteMDI::processCloseList() {
if (m_closelist.begin() != m_closelist.end()) {
KMdiMainFrm::childWindowCloseRequest(*m_closelist.begin());
}
}
void RemoteMDI::currentChanged(KMdiChildView *current)
{
// Update status bar and list box
statusBar()->message(i18n( "%1 activated").arg(current->tabCaption()));
TQListBoxItem *item = m_listBox->findItem(current->tabCaption());
assert(item);
m_listBox->setCurrentItem(item);
}
void RemoteMDI::closeCurrent()
{
// If there's a current view, close it
if ( m_pCurrentWindow != 0 ) {
// Notify the status bar of the removal of the window
statusBar()->message(i18n("%1 removed").arg(m_pCurrentWindow->tabCaption()));
// Remove from the window list
m_window.remove(m_window.find(m_pCurrentWindow));
// Remove from the list box
TQListBoxItem *item = m_listBox->findItem(m_pCurrentWindow->tabCaption());
assert( item );
delete item;
// We could also call removeWindowFromMdi, but it doesn't delete the
// pointer. This way, we're sure that the view will get deleted.
closeWindow(m_pCurrentWindow);
}
// Synchronize combo box
if (m_pCurrentWindow) {
currentChanged(m_pCurrentWindow);
}
}
void RemoteMDI::listBoxExecuted(TQListBoxItem *item)
{
// Get the current item's text
TQString text = item->text();
// Active the corresponding tab
for (TQValueList< KMdiChildView *>::iterator it = m_window.begin(); it != m_window.end(); ++it ) {
// Get the view
KMdiChildView *view = *it;
assert(view);
// Is the view we need to show?
if (view->caption() == text) {
view->activate();
break;
}
}
}
void RemoteMDI::childClosed(KMdiChildView * w)
{
assert(w);
// Set as active
w->activate();
assert(w == m_pCurrentWindow);
// Notify the status bar of the removal of the window
statusBar()->message(i18n("%1 removed").arg(w->tabCaption()));
// Remove from the window list
m_window.remove(m_window.find(w));
// Remove from the list box
TQListBoxItem *item = m_listBox->findItem( w->tabCaption() );
assert(item);
delete item;
// Remove the view from MDI, BUT DO NOT DELETE IT! It is automatically deleted by TQt since it was closed.
removeWindowFromMdi(w);
}
bool RemoteMDI::queryClose()
{
// Close all open connections
for (TQValueList< KMdiChildView *>::iterator it = m_window.begin(); it != m_window.end(); ++it ) {
RemoteLab::InstrumentView* iview = dynamic_cast<RemoteLab::InstrumentView*>(*it);
if (iview) {
iview->closeConnections();
}
}
// Save current MDI mode
KConfig *c = kapp->config();
// Put in value a matching string value
TQString value;
switch (mdiMode()) {
case KMdi::ToplevelMode:
value = "toplevel";
break;
case KMdi::ChildframeMode:
value = "childframe";
break;
case KMdi::TabPageMode:
value = "tabpage";
break;
case KMdi::IDEAlMode:
value = "ideal";
break;
case KMdi::UndefinedMode:
value = "ideal";
break;
}
// Write it!
c->writeEntry( "MDIMode", value );
c->sync();
// Allow to close the window
return true;
}
#include "remotemdi.moc"

@ -0,0 +1,68 @@
//Author: Timothy Pearson <kb9vqf@pearsoncomputing.net>, (C) 2012
//Copyright: See COPYING file that comes with this distribution
#ifndef _REMOTEMDI_H_
#define _REMOTEMDI_H_
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <tqvaluelist.h>
#include <kmdimainfrm.h>
class KMdiChildView;
class KListBox;
class TQListBoxItem;
/**
* @short Remote Laboratory Main Window
* @author Timothy Pearson <kb9vqf@pearsoncomputing.net>
* @version 0.1
*/
class RemoteMDI : public KMdiMainFrm
{
Q_OBJECT
public:
/**
* Default Constructor
*/
RemoteMDI(KMdi::MdiMode mode);
/**
* Default Destructor
*/
virtual ~RemoteMDI();
void setServerHost(TQString server);
public slots:
virtual void childWindowCloseRequest(KMdiChildView *pWnd);
void processCloseList();
protected slots:
void openNewWindow(KMdiChildView *view=0);
void currentChanged(KMdiChildView *current);
void closeCurrent();
void listBoxExecuted(TQListBoxItem *);
void childClosed(KMdiChildView *w);
private slots:
void configToolbars();
void configKeys();
void startSpectrumAnalyzer();
protected:
virtual bool queryClose();
unsigned m_children;
TQString m_serverHost;
TQValueList<KMdiChildView*> m_window;
TQValueList<KMdiChildView*> m_closelist;
KListBox *m_listBox;
};
#endif // _REMOTEMDI_H_

@ -0,0 +1,5 @@
INCLUDES = -I$(top_srcdir)/src/part $(all_includes)
METASOURCES = AUTO
noinst_LTLIBRARIES = libinstrumentview.la
libinstrumentview_la_SOURCES = instrumentview.cpp

@ -0,0 +1,75 @@
//Author: Timothy Pearson <kb9vqf@pearsoncomputing.net>, (C) 2012
//Copyright: See COPYING file that comes with this distribution
#include "instrumentview.h"
#include <tqtimer.h>
#include <klibloader.h>
#include <klocale.h>
#include <kmessagebox.h>
namespace RemoteLab {
InstrumentView::InstrumentView(const TQString &library, TQWidget *parentWidget, const char *name, WFlags f)
: KMdiChildView(parentWidget, name, f)
, m_libraryName(library)
, m_instrumentPart( 0 )
{
init();
}
InstrumentView::InstrumentView(const TQString &library, const TQString &caption, TQWidget *parentWidget, const char *name, WFlags f)
: KMdiChildView(caption, parentWidget, name, f)
, m_libraryName(library)
, m_instrumentPart( 0 )
{
init();
}
InstrumentView::~InstrumentView() {
//
}
void InstrumentView::init() {
KLibFactory *factory = KLibLoader::self()->factory(m_libraryName.ascii());
if (!factory) {
KMessageBox::error( this, i18n("TDE could not find the Remote Laboratory Communications Analyzer Part, or the Remote Laboratory Communications Analyzer Part could not be started. Did you make install?") );
TQTimer::singleShot(0, this, SLOT(close()));
}
else {
m_instrumentPart = (InstrumentPart *)factory->create(TQT_TQOBJECT(this), "part", "KParts::ReadOnlyPart");
}
}
bool InstrumentView::queryExit() {
if( !m_instrumentPart ) //apparently std::exit() still calls this function, and abort() causes a crash..
return true;
m_instrumentPart->closeURL();
return true;
}
void InstrumentView::closeConnections() {
queryExit();
}
void InstrumentView::connectServer(TQString server) {
if (m_instrumentPart) {
m_instrumentPart->openURL(KURL(server));
}
}
/**********************************************
SESSION MANAGEMENT
**********************************************/
void InstrumentView::saveProperties( KConfig *config ) {
}
void InstrumentView::readProperties( KConfig *config ) {
}
} //namespace RemoteLab

@ -0,0 +1,41 @@
//Author: Timothy Pearson <kb9vqf@pearsoncomputing.net>, (C) 2012
//Copyright: See COPYING file that comes with this distribution
#ifndef SPECTRUMANALYZERVIEW_H
#define SPECTRUMANALYZERVIEW_H
#include <kconfig.h>
#include <kparts/part.h>
#include <kmdichildview.h>
class KAction;
namespace RemoteLab {
typedef KParts::ReadOnlyPart InstrumentPart;
class InstrumentView : public KMdiChildView
{
Q_OBJECT
public:
InstrumentView(const TQString &library, TQWidget *parentWidget=0L, const char *name=0L, WFlags f=0);
InstrumentView(const TQString &library, const TQString &caption, TQWidget *parentWidget=0L, const char *name=0L, WFlags f=0);
~InstrumentView();
void connectServer(TQString server);
void closeConnections();
protected:
virtual void saveProperties( KConfig * );
virtual void readProperties( KConfig * );
virtual bool queryExit();
private:
void init();
TQString m_libraryName;
RemoteLab::InstrumentPart *m_instrumentPart;
};
} // namespace RemoteLab
#endif

@ -0,0 +1,17 @@
//Author: Timothy Pearson <kb9vqf@pearsoncomputing.net>, (C) 2012
//Copyright: See COPYING file that comes with this distribution
#ifndef DEFINE_H
#define DEFINE_H
#include "config.h"
#undef VERSION
#undef PACKAGE
#undef PRETTYNAME
#define APP_NAME "remote_laboratory_client"
#define APP_VERSION "1.0"
#define APP_PRETTYNAME "Remote Laboratory Client"
#endif

@ -0,0 +1 @@
SUBDIRS = commanalyzer

@ -0,0 +1,9 @@
INCLUDES = $(all_includes) -I$(top_srcdir)/src -I$(top_srcdir)/src/widgets
METASOURCES = AUTO
#Part
kde_module_LTLIBRARIES = libremotelab_commanalyzer.la
libremotelab_commanalyzer_la_LIBADD = ../../widgets/libtracewidget.la ../../widgets/libfloatspinbox.la $(LIB_KFILE) $(LIB_KPARTS) $(LIB_TDEUI) $(LIB_QT)
libremotelab_commanalyzer_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -ltdecore -ltdeui -lkio -ltdefx
libremotelab_commanalyzer_la_SOURCES = \
part.cpp layout.ui

@ -0,0 +1,36 @@
//Author: Max Howell <max.howell@methylblue.com>, (C) 2003-4
//Copyright: See COPYING file that comes with this distribution
#ifndef DEBUG_H
#define DEBUG_H
/** Fancy debug header
* @author Max Howell
*
* Define DEBUG_PREFIX as a string before you include this to insert a fancy debug prefix
* Debug::debug(), can be used as debug() and is just kdDebug()
* use Debug::indent() and Debug::unindent()
*/
#include <kdebug.h>
#ifdef NDEBUG
static inline kndbgstream debug() { return kndbgstream(); }
#else
static inline kdbgstream debug()
{
return kdbgstream(
#ifdef DEBUG_PREFIX
"[" DEBUG_PREFIX "] ",
#endif
0, 0 );
}
#endif
#define error kdError
#define fatal kdFatal
#define warning kdWarning
#define DEBUG_ANNOUNCE debug() << ">> " << __PRETTY_FUNCTION__ << endl;
#endif

@ -0,0 +1,159 @@
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
<class>CommAnalyzerBase</class>
<widget class="TQWidget">
<property name="name">
<cstring>CommAnalyzerBase</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>519</width>
<height>356</height>
</rect>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="TQTabWidget" row="0" column="0">
<property name="name">
<cstring>TabWidget2</cstring>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<widget class="TQWidget">
<property name="name">
<cstring>tab</cstring>
</property>
<attribute name="title">
<string>Spectrum Analyzer</string>
</attribute>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="TQGroupBox" row="0" column="0">
<property name="name">
<cstring>groupSpectrumAnalyzer</cstring>
</property>
<property name="title">
<string>Spectrum Analyzer</string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="TQGroupBox" row="0" column="0">
<property name="name">
<cstring>groupSpectrumAnalyzerView</cstring>
</property>
<property name="title">
<string>Trace Viewer</string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="TraceWidget" row="0" column="0" colspan="1">
<property name="name">
<cstring>traceWidget</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
</widget>
</grid>
</widget>
<widget class="TQGroupBox" row="0" column="1">
<property name="name">
<cstring>groupSpectrumAnalyzerRecControls</cstring>
</property>
<property name="title">
<string>Receiver Controls</string>
</property>
<grid>
<widget class="TQLabel" row="0" column="0" colspan="1">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>Reference Power Level:</string>
</property>
<property name="textFormat">
<enum>PlainText</enum>
</property>
</widget>
<widget class="FloatSpinBox" row="0" column="1" colspan="1">
<property name="name">
<cstring>saRefLevel</cstring>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maxValue">
<number>128</number>
</property>
<property name="minValue">
<number>-128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
<widget class="TQLabel" row="0" column="3" colspan="1">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>dBm</string>
</property>
<property name="textFormat">
<enum>PlainText</enum>
</property>
</widget>
</grid>
</widget>
</grid>
</widget>
</grid>
</widget>
</widget>
</grid>
</widget>
<includes>
<include location="local" impldecl="in implementation">CommAnalyzerBase.ui.h</include>
</includes>
<includes>
<include location="local" impldecl="in implementation">tracewidget.h</include>
<include location="local" impldecl="in implementation">floatspinbox.h</include>
</includes>
<layoutdefaults spacing="3" margin="6"/>
<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
</UI>

@ -0,0 +1,68 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>CommAnalyzerBase</class>
<widget class="TQWidget">
<property name="name">
<cstring>CommAnalyzerBase</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>519</width>
<height>356</height>
</rect>
</property>
<property name="caption">
<string>CommAnalyzerBase</string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="TQTabWidget" row="0" column="0">
<property name="name">
<cstring>TabWidget2</cstring>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<widget class="TQWidget">
<property name="name">
<cstring>tab</cstring>
</property>
<attribute name="title">
<string>Spectrum Analyzer</string>
</attribute>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="TQGroupBox" row="0" column="0">
<property name="name">
<cstring>groupSpectrumAnalyzer</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Spectrum Analyzer</string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
</grid>
</widget>
</grid>
</widget>
</widget>
</grid>
</widget>
<layoutdefaults spacing="3" margin="6"/>
<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
</UI>

@ -0,0 +1,396 @@
//Author: Timothy Pearson <kb9vqf@pearsoncomputing.net>, (C) 2012
//Copyright: See COPYING file that comes with this distribution
#include "debug.h"
#include "define.h"
#include "part.h"
#include <kaboutdata.h> //::createAboutData()
#include <kaction.h>
#include <klocale.h>
#include <kmessagebox.h> //::start()
#include <kparts/genericfactory.h>
#include <kstatusbar.h>
#include <kstdaction.h>
#include <tqfile.h> //encodeName()
#include <tqtimer.h> //postInit() hack
#include <tqvbox.h>
#include <tqsocket.h>
#include <tqmutex.h>
#include <tqeventloop.h>
#include <tqapplication.h>
#include <unistd.h> //access()
#include <stdint.h>
#include "tracewidget.h"
#include "floatspinbox.h"
#include "layout.h"
namespace RemoteLab {
typedef KParts::GenericFactory<RemoteLab::CommAnalyzerPart> Factory;
K_EXPORT_COMPONENT_FACTORY( libremotelab_commanalyzer, RemoteLab::Factory )
CommAnalyzerPart::CommAnalyzerPart( TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name, const TQStringList& )
: ReadOnlyPart( parent, name ), m_traceWidget(0), m_socket(0), m_base(0), stopTraceUpdate(false)
{
// Initialize mutex
m_instrumentMutex = new TQMutex(false);
// Initialize kpart
setInstance(Factory::instance());
setWidget(new TQVBox(parentWidget, widgetName));
// Create widgets
m_base = new CommAnalyzerBase(widget());
m_traceWidget = m_base->traceWidget;
m_base->saRefLevel->setFloatMin(-128);
m_base->saRefLevel->setFloatMax(128);
m_base->saRefLevel->setLineStep(1);
connect(m_base->saRefLevel, SIGNAL(floatValueChanged(double)), this, SLOT(saRefLevelChanged(double)));
TQTimer::singleShot(0, this, TQT_SLOT(postInit()));
}
CommAnalyzerPart::~CommAnalyzerPart() {
if (m_traceWidget) {
delete m_traceWidget;
}
if (m_socket) {
m_socket->close();
while (m_socket->state() == TQSocket::Closing) {
tqApp->processEvents();
}
delete m_socket;
}
delete m_instrumentMutex;
}
void CommAnalyzerPart::postInit() {
m_updateTimer = new TQTimer(this);
connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateTrace()));
}
bool CommAnalyzerPart::openURL(const KURL &url) {
connectToServer(url.url());
}
bool CommAnalyzerPart::closeURL() {
m_socket->close();
while (m_socket->state() != TQSocket::Idle) {
tqApp->processEvents();
}
m_url = KURL();
return true;
}
TQString CommAnalyzerPart::callServerMethod(int command) {
if (m_instrumentMutex->locked() == true) {
printf("[WARN] An attempt was made to access the instrument asynchronously, and was rejected to prevent a lockup\n\r"); fflush(stdout);
return TQString::null;
}
m_instrumentMutex->lock();
if (m_socket->state() == TQSocket::Connected) {
TQString cmd = TQChar(command);
cmd.append('\r');
m_socket->writeBlock(cmd.latin1(), cmd.length());
// Read from the server
TQString serverRet;
while ((!serverRet.contains('\r')) && (m_socket->state() == TQSocket::Connected)) {
char data[1];
if( m_socket->readBlock(data, 1) > 0) {
serverRet.append(data[0]);
}
tqApp->eventLoop()->processEvents(TQEventLoop::AllEvents);
}
m_instrumentMutex->unlock();
return serverRet;
}
else {
m_instrumentMutex->unlock();
return TQString::null;
}
}
int16_t CommAnalyzerPart::callServerMethodInt16(int command) {
if (m_instrumentMutex->locked() == true) {
printf("[WARN] An attempt was made to access the instrument asynchronously, and was rejected to prevent a lockup\n\r"); fflush(stdout);
return 0;
}
m_instrumentMutex->lock();
if (m_socket->state() == TQSocket::Connected) {
TQString cmd = TQChar(command);
cmd.append('\r');
m_socket->writeBlock(cmd.latin1(), cmd.length());
// Read from the server
int bytesread = 0;
int16_t data[1];
while ((bytesread < 2) && (m_socket->state() == TQSocket::Connected)) {
int ret = m_socket->readBlock(((char*)data)+bytesread, 1);
if (ret > 0) {
bytesread += ret;
}
tqApp->eventLoop()->processEvents(TQEventLoop::AllEvents);
}
TQString serverRet;
while ((!serverRet.contains('\r')) && (m_socket->state() == TQSocket::Connected)) {
char data[1];
if( m_socket->readBlock(data, 1) > 0) {
serverRet.append(data[0]);
}
tqApp->eventLoop()->processEvents(TQEventLoop::AllEvents);
}
m_instrumentMutex->unlock();
return data[0];
}
else {
m_instrumentMutex->unlock();
return 0;
}
}
double CommAnalyzerPart::callServerMethodDouble(int command) {
if (m_instrumentMutex->locked() == true) {
printf("[WARN] An attempt was made to access the instrument asynchronously, and was rejected to prevent a lockup\n\r"); fflush(stdout);
return 0;
}
m_instrumentMutex->lock();
if (m_socket->state() == TQSocket::Connected) {
TQString cmd = TQChar(command);
cmd.append('\r');
m_socket->writeBlock(cmd.latin1(), cmd.length());
// Read from the server
unsigned int bytesread = 0;
double data[1];
while ((bytesread < sizeof(double)) && (m_socket->state() == TQSocket::Connected)) {
int ret = m_socket->readBlock(((char*)data)+bytesread, 1);
if (ret > 0) {
bytesread += ret;
}
tqApp->eventLoop()->processEvents(TQEventLoop::AllEvents);
}
TQString serverRet;
while ((!serverRet.contains('\r')) && (m_socket->state() == TQSocket::Connected)) {
char data[1];
if( m_socket->readBlock(data, 1) > 0) {
serverRet.append(data[0]);
}
tqApp->eventLoop()->processEvents(TQEventLoop::AllEvents);
}
m_instrumentMutex->unlock();
return data[0];
}
else {
m_instrumentMutex->unlock();
return 0;
}
}
void CommAnalyzerPart::sendServerCommandWithParameter(int command, TQString param) {
if (m_instrumentMutex->locked() == true) {
printf("[WARN] An attempt was made to access the instrument asynchronously, and was rejected to prevent a lockup\n\r"); fflush(stdout);
return;
}
m_instrumentMutex->lock();
if (m_socket->state() == TQSocket::Connected) {
TQString cmd = TQChar(command);
param = TQString("%1%2%3").arg(param).arg(TQChar('°')).arg(TQChar('\r'));
cmd += param;
m_socket->writeBlock(cmd.ascii(), cmd.length());
// Read from the server
TQString serverRet;
while ((!serverRet.contains('\r')) && (m_socket->state() == TQSocket::Connected)) {
char data[1];
if( m_socket->readBlock(data, 1) > 0) {
serverRet.append(data[0]);
}
tqApp->eventLoop()->processEvents(TQEventLoop::AllEvents);
}
}
m_instrumentMutex->unlock();
}
void CommAnalyzerPart::sendServerCommand(int command) {
if (m_instrumentMutex->locked() == true) {
printf("[WARN] An attempt was made to access the instrument asynchronously, and was rejected to prevent a lockup\n\r"); fflush(stdout);
return;
}
m_instrumentMutex->lock();
if (m_socket->state() == TQSocket::Connected) {
TQString cmd = TQChar(command);
cmd.append('\r');
m_socket->writeBlock(cmd.latin1(), cmd.length());
// Read from the server
TQString serverRet;
while ((!serverRet.contains('\r')) && (m_socket->state() == TQSocket::Connected)) {
char data[1];
if( m_socket->readBlock(data, 1) > 0) {
serverRet.append(data[0]);
}
tqApp->eventLoop()->processEvents(TQEventLoop::AllEvents);
}
}
m_instrumentMutex->unlock();
}
void CommAnalyzerPart::callServerMethodDoubleArray(int command, double * array, int arrayLen) {
if (m_instrumentMutex->locked() == true) {
printf("[WARN] An attempt was made to access the instrument asynchronously, and was rejected to prevent a lockup\n\r"); fflush(stdout);
return;
}
m_instrumentMutex->lock();
if (m_socket->state() == TQSocket::Connected) {
TQString cmd = TQChar(command);
cmd.append('\r');
m_socket->writeBlock(cmd.latin1(), cmd.length());
// Read from the server
TQString serverRet;
while ((!serverRet.contains('\r')) && (m_socket->state() == TQSocket::Connected)) {
char data[1];
if( m_socket->readBlock(data, 1) > 0) {
serverRet.append(data[0]);
}
tqApp->eventLoop()->processEvents(TQEventLoop::AllEvents);
}
unsigned int bytesread = 0;
int16_t data[1];
while ((bytesread < 2) && (m_socket->state() == TQSocket::Connected)) {
int ret = m_socket->readBlock(((char*)data)+bytesread, 1);
if (ret > 0) {
bytesread += ret;
}
tqApp->eventLoop()->processEvents(TQEventLoop::AllEvents);
}
serverRet = "";
while ((!serverRet.contains('\r')) && (m_socket->state() == TQSocket::Connected)) {
char data[1];
if( m_socket->readBlock(data, 1) > 0) {
serverRet.append(data[0]);
}
tqApp->eventLoop()->processEvents(TQEventLoop::AllEvents);
}
bytesread = 0;
int elementsread = 0;
for (elementsread=0;elementsread<arrayLen;elementsread++) {
bytesread = 0;
while ((bytesread < sizeof(double)) && (m_socket->state() == TQSocket::Connected)) {
if (m_socket->size() < 1) {
tqApp->eventLoop()->processEvents(TQEventLoop::AllEvents);
}
int ret = m_socket->readBlock(((char*)array)+bytesread+(elementsread*sizeof(double)), 1);
if (ret > 0) {
bytesread += ret;
}
}
}
}
m_instrumentMutex->unlock();
}
int CommAnalyzerPart::connectToServer(TQString server) {
if (!m_socket) {
m_socket = new TQSocket(this);
// connect(m_socket, SIGNAL(connected()), SLOT(socketConnected()));
// connect(m_socket, SIGNAL(connectionClosed()), SLOT(socketConnectionClosed()));
// connect(m_socket, SIGNAL(readyRead()), SLOT(socketReadyRead()));
// connect(m_socket, SIGNAL(error(int)), SLOT(socketError(int)));
}
m_socket->connectToHost(server, 4002);
while ((m_socket->state() != TQSocket::Connected) && (m_socket->state() != TQSocket::Idle)) {
tqApp->eventLoop()->processEvents(TQEventLoop::AllEvents);
}
if (m_socket->state() != TQSocket::Connected) {
return -1;
}
// Gather information from the server
if (callServerMethod(41) == "NCK") {
// FIXME
// Display message and exit
return -1;
}
sendServerCommand(40); // Set spectrum analyzer mode
m_samplesInTrace = callServerMethodInt16(63); // Get number of samples in trace
m_traceWidget->setNumberOfSamples(m_samplesInTrace);
m_hdivs = callServerMethodInt16(62); // Get number of horizontal divisions
m_traceWidget->setNumberOfHorizontalDivisions(m_hdivs);
m_vdivs = callServerMethodInt16(64); // Get number of vertical divisions
m_traceWidget->setNumberOfVerticalDivisions(m_vdivs);
m_rpower = callServerMethodDouble(65); // Get reference power level
m_vscale = callServerMethodDouble(66); // Get vertical division scale
m_centerfreq = callServerMethodDouble(67); // Get center frequency
m_spanfreq = callServerMethodDouble(68); // Get frequency span
updateGraticule();
// Start trace update timer
m_updateTimer->start(10, FALSE);
}
void CommAnalyzerPart::postProcessTrace() {
return;
}
void CommAnalyzerPart::updateTrace() {
m_updateTimer->stop();
callServerMethodDoubleArray(42, m_traceWidget->samples(), m_samplesInTrace);
postProcessTrace();
m_traceWidget->repaint();
if (m_socket->state() == TQSocket::Connected) {
if (stopTraceUpdate == true) {
stopTraceUpdate = false;
}
else {
m_updateTimer->start(10, FALSE);
}
}
}
void CommAnalyzerPart::updateGraticule() {
m_leftFrequency = m_centerfreq - (m_spanfreq/2.0);
m_rightFrequency = m_centerfreq + (m_spanfreq/2.0);
m_traceWidget->setDisplayLimits(m_leftFrequency, m_rpower, m_rightFrequency, m_rpower-(m_vscale*m_hdivs));
// Also update controls
m_base->saRefLevel->blockSignals(true);
m_base->saRefLevel->setFloatValue(m_rpower);
m_base->saRefLevel->blockSignals(false);
}
void CommAnalyzerPart::saRefLevelChanged(double newval) {
// We cannot directly send data to the remote instrument because the GUI event may have ocurred during a remote instrument transaction
// This "flaw" is a direct result of maximizing performance by processing GUI events during network transfers, as well as the fact that this client is a multithreaded application
m_rpower = newval;
stopTraceUpdate = true;
TQTimer::singleShot(0, this, SLOT(changeSaRefLevel()));
}
void CommAnalyzerPart::changeSaRefLevel() {
// Keep trying to set the new power level
if (m_instrumentMutex->locked() == false) {
sendServerCommandWithParameter(61, TQString("%1").arg(m_rpower, 0, 'E')); // Set reference power level
m_rpower = callServerMethodDouble(65); // Get reference power level
updateGraticule(); // Update the display grid
m_updateTimer->start(10, FALSE); // Restart trace update timer
}
else {
tqApp->eventLoop()->processEvents(TQEventLoop::ExcludeUserInput);
TQTimer::singleShot(0, this, SLOT(changeSaRefLevel()));
}
}
KAboutData* CommAnalyzerPart::createAboutData() {
return new KAboutData( APP_NAME, I18N_NOOP( APP_PRETTYNAME ), APP_VERSION );
}
} //namespace RemoteLab
#include "part.moc"

@ -0,0 +1,73 @@
//Author: Timothy Pearson <kb9vqf@pearsoncomputing.net>, (C) 2012
//Copyright: See COPYING file that comes with this distribution
#ifndef REMOTELAB_COMMANALYZERPART_H
#define REMOTELAB_COMMANALYZERPART_H
#include <kparts/browserextension.h>
#include <kparts/statusbarextension.h>
#include <kparts/part.h>
#include <kurl.h>
class KAboutData;
using KParts::StatusBarExtension;
class TraceWidget;
class TQSocket;
class TQTimer;
class TQMutex;
class CommAnalyzerBase;
namespace RemoteLab
{
class CommAnalyzerPart : public KParts::ReadOnlyPart
{
Q_OBJECT
public:
CommAnalyzerPart( QWidget *, const char *, TQObject *, const char *, const TQStringList&);
~CommAnalyzerPart();
virtual bool openFile() { return false; } // pure virtual in the base class
virtual bool closeURL();
static KAboutData *createAboutData();
int connectToServer(TQString server);
public slots:
virtual bool openURL(const KURL &url);
private slots:
void postInit();
void updateTrace();
void updateGraticule();
virtual void postProcessTrace();
void saRefLevelChanged(double);
void changeSaRefLevel();
private:
TQString callServerMethod(int command);
void sendServerCommand(int command);
int16_t callServerMethodInt16(int command);
double callServerMethodDouble(int command);
void callServerMethodDoubleArray(int command, double * array, int arrayLen);
void sendServerCommandWithParameter(int command, TQString param);
private:
TraceWidget* m_traceWidget;
TQSocket* m_socket;
int16_t m_samplesInTrace;
double m_leftFrequency;
double m_rightFrequency;
int16_t m_hdivs;
int16_t m_vdivs;
double m_centerfreq;
double m_spanfreq;
double m_rpower;
double m_vscale;
TQTimer* m_updateTimer;
CommAnalyzerBase* m_base;
TQMutex* m_instrumentMutex;
bool stopTraceUpdate;
};
}
#endif

@ -0,0 +1,5 @@
INCLUDES = $(all_includes)
METASOURCES = AUTO
noinst_LTLIBRARIES = libtracewidget.la libfloatspinbox.la
libtracewidget_la_SOURCES = tracewidget.cpp
libfloatspinbox_la_SOURCES = floatspinbox.cpp

@ -0,0 +1,87 @@
// Copyright: See COPYING file that comes with this distribution
//
// Original Author: Ewald R. de Wit
// From Qt-Interest mailing list
// http://lists.trolltech.com/qt-interest/1999-07/thread00400-0.html
//
// (c) 2012 Timothy Pearson <kb9vqf@pearsoncomputing.net>
#include <tqvalidator.h>
#include <math.h>
#include "floatspinbox.h"
#define ROUND(x) ((int)(0.5 + (x)))
FloatSpinBox::FloatSpinBox(double fmin, double fmax, double fvalue, TQWidget *parent) : TQSpinBox(parent)
{
init(fmin, fmax, fvalue);
connect( this, SIGNAL(valueChanged(int)), SLOT(acceptValueChanged(int)) );
}
FloatSpinBox::FloatSpinBox(TQWidget *parent , const char* name) : TQSpinBox(parent, name)
{
connect( this, SIGNAL(valueChanged(int)), SLOT(acceptValueChanged(int)) );
}
void FloatSpinBox::init(double fmin, double fmax, double fvalue) {
min = fmin;
max = fmax;
value = fvalue;
// How many decimals after the floating point?
dec = ((fmax - fmin) == 0) ? 2 : 2 - (int)( log10(fabs(fmax - fmin)) );
if (dec < 0) dec = 0;
int intmax = (int)((max - min) * pow( 10, dec ));
int intval = ROUND( (value - min) * pow( 10, dec ) );
setRange( 0, intmax );
setValue( intval );
setSteps( 10, 100 );
TQDoubleValidator *validator = new TQDoubleValidator(min, max, dec, this);
setValidator(validator);
}
void FloatSpinBox::setFloatMin(double fmin) {
init(fmin, max, value);
}
void FloatSpinBox::setFloatMax(double fmax) {
init(min, fmax, value);
}
TQString FloatSpinBox::mapValueToText(int ival)
{
TQString str;
value = min + (double)ival * pow(10, -dec);
str.sprintf("%.*f", dec, value);
return( str );
}
int FloatSpinBox::mapTextToValue (bool * ok)
{
TQString str = cleanText();
double tryValue = str.toDouble( ok );
if (*ok) {
value = tryValue;
}
return ROUND( (value - min) * pow( 10, dec ) );
}
void FloatSpinBox::setFloatValue(double d)
{
value = d;
setValue( ROUND( (value - min) * pow( 10, dec )) );
}
void FloatSpinBox::acceptValueChanged(int ival)
{
emit floatValueChanged( value );
}
FloatSpinBox::~FloatSpinBox()
{
//
}

@ -0,0 +1,48 @@
// Copyright: See COPYING file that comes with this distribution
//
// Original Author: Ewald R. de Wit
// From Qt-Interest mailing list
// http://lists.trolltech.com/qt-interest/1999-07/thread00400-0.html
//
// (c) 2012 Timothy Pearson <kb9vqf@pearsoncomputing.net>
#ifndef FLOATSPINBOX_H
#define FLOATSPINBOX_H
#include <tqstring.h>
#include <tqspinbox.h>
class FloatSpinBox : public TQSpinBox
{
Q_OBJECT
public:
FloatSpinBox(TQWidget *parent = 0, const char* name = 0);
FloatSpinBox(double min, double max, double value, TQWidget *parent = 0);
~FloatSpinBox();
void init(double min, double max, double value);
void setFloatMin(double min);
void setFloatMax(double max);
private:
int dec;
virtual TQString mapValueToText(int value);
virtual int mapTextToValue(bool * ok);
public slots:
void setFloatValue(double d);
private slots:
void acceptValueChanged(int value);
signals:
void floatValueChanged(double value);
private:
double min;
double max;
double value;
};
#endif // FLOATSPINBOX_H

@ -0,0 +1,124 @@
//Author: Timothy Pearson <kb9vqf@pearsoncomputing.net>, (C) 2012
//Copyright: See COPYING file that comes with this distribution
#include "tracewidget.h"
#include <stdlib.h>
#include <tqpixmap.h>
#include <tqpainter.h>
TraceWidget::TraceWidget(TQWidget* parent, const char* name) : TQWidget(parent, name),
m_samples(0),
m_horizDivs(0),
m_vertDivs(0),
m_leftEdge(0),
m_rightEdge(0),
m_topEdge(0),
m_bottomEdge(0),
m_sampleArray(0),
m_graticulePixmap(0) {
setBackgroundMode(NoBackground);
setPaletteBackgroundColor(TQt::black);
setPaletteForegroundColor(TQColor(0,128,0));
}
TraceWidget::~TraceWidget() {
//
}
void TraceWidget::setNumberOfSamples(unsigned int samples) {
m_samples = samples;
if (m_sampleArray) {
delete [] m_sampleArray;
}
m_sampleArray = new double[m_samples];
updateGraticule();
}
void TraceWidget::setNumberOfHorizontalDivisions(unsigned int divisions) {
m_horizDivs = divisions;
updateGraticule();
}
void TraceWidget::setNumberOfVerticalDivisions(unsigned int divisions) {
m_vertDivs = divisions;
updateGraticule();
}
void TraceWidget::setDisplayLimits(double x, double y, double w, double h) {
m_leftEdge = x;
m_rightEdge = w;
m_topEdge = y;
m_bottomEdge = h;
}
double* TraceWidget::samples() {
return m_sampleArray;
}
void TraceWidget::updateGraticule() {
unsigned int d,s,x,y;
if (m_graticulePixmap) {
delete m_graticulePixmap;
}
m_graticulePixmap = new TQPixmap(width(), height());
// Draw the graticule into the pixmap
TQPainter p(m_graticulePixmap);
p.setPen(TQPen(foregroundColor(), 1, TQt::SolidLine));
p.fillRect(0, 0, m_graticulePixmap->width(), m_graticulePixmap->height(), backgroundColor());
p.setPen(TQPen(foregroundColor(), 1, TQt::DotLine));
if (m_vertDivs > 0) {
s = m_graticulePixmap->width() / m_vertDivs;
x = 0;
for (d=0; d<m_vertDivs; d++) {
p.drawLine(x, 0, x, m_graticulePixmap->height());
x += s;
}
}
if (m_horizDivs > 0) {
s = m_graticulePixmap->height() / m_horizDivs;
y = 0;
for (d=0; d<m_horizDivs; d++) {
p.drawLine(0, y, m_graticulePixmap->width(), y);
y += s;
}
}
p.setPen(TQPen(foregroundColor(), 1, TQt::SolidLine));
p.drawRect(0, 0, m_graticulePixmap->width(), m_graticulePixmap->height());
// Repaint the widget
repaint();
}
void TraceWidget::paintEvent(TQPaintEvent*) {
TQPainter p(this);
p.setPen(foregroundColor().light(150));
if ((m_graticulePixmap) && (m_bottomEdge != m_topEdge)) {
// Draw the graticule pixmap to erase the widget
p.drawPixmap(0, 0, *m_graticulePixmap);
// Draw the points
unsigned int n;
int x,y,x2,y2;
for (n=0; n<m_samples-1; n++) {
x = abs(((n*1.0)/(m_samples-1))*(m_graticulePixmap->width()));
y = abs(((m_sampleArray[n]-m_topEdge)/(m_bottomEdge-m_topEdge))*(m_graticulePixmap->height()));
x2 = abs(((n+1*1.0)/(m_samples-1))*(m_graticulePixmap->width()));
y2 = abs(((m_sampleArray[n+1]-m_topEdge)/(m_bottomEdge-m_topEdge))*(m_graticulePixmap->height()));
p.drawLine(x, y, x2, y2);
}
}
else {
p.fillRect(x(), y(), width(), height(), backgroundColor());
}
}
void TraceWidget::resizeEvent(TQResizeEvent *) {
updateGraticule();
}

@ -0,0 +1,40 @@
//Author: Timothy Pearson <kb9vqf@pearsoncomputing.net>, (C) 2012
//Copyright: See COPYING file that comes with this distribution
#include <tqwidget.h>
class TQPixmap;
class TraceWidget : public TQWidget
{
Q_OBJECT
public:
TraceWidget(TQWidget* = 0, const char* = 0);
~TraceWidget();
void setNumberOfSamples(unsigned int samples);
void setNumberOfHorizontalDivisions(unsigned int divisions);
void setNumberOfVerticalDivisions(unsigned int divisions);
void setDisplayLimits(double x, double y, double w, double h);
double* samples();
protected:
virtual void paintEvent(TQPaintEvent*);
virtual void resizeEvent(TQResizeEvent *);
private slots:
void updateGraticule();
private:
unsigned int m_samples;
unsigned int m_horizDivs;
unsigned int m_vertDivs;
double m_leftEdge;
double m_rightEdge;
double m_topEdge;
double m_bottomEdge;
double* m_sampleArray;
TQPixmap* m_graticulePixmap;
};

@ -0,0 +1,4 @@
doc
misc
po
src

@ -653,4 +653,310 @@ int commanalyzer_get_spectrum_analyzer_number_of_vertical_divisions( char * comm
else {
return -1;
}
}
int commanalyzer_get_spectrum_analyzer_number_of_horizontal_divisions( char * commanalyzerType, int gpibDevice) {
if ((strcmp("HP8924C", commanalyzerType) == 0)) {
return 10;
}
else {
return -1;
}
}
double commanalyzer_get_spectrum_analyzer_reference_power_level(double * retval, char * commanalyzerType, int gpibDevice) {
unsigned char segarray[4194304];
unsigned char floatstring[1024];
long array_pointer;
long ai;
long left_char;
long right_char;
int max_num_bytes = 0;
if ((strcmp("HP8924C", commanalyzerType) == 0)) {
// Send request
printf("[INFO] Getting spectrum analyzer reference power level\n\r");
if (strcmp("HP8924C", commanalyzerType) == 0) {
sprintf(falpha,"SAN:RLEV?");
#ifdef ENABLE_EXTRA_DEBUGGING
printf("[DEBG] Writing: %s\n\r", falpha);
#endif
if (gpib_write(gpibDevice, falpha) == 0) {
max_num_bytes = 24; // Request more bytes than are possible to ensure no bytes are left behind
}
else {
return 2;
}
}
// Read response
#ifdef ENABLE_EXTRA_DEBUGGING
printf("[DEBG] Trying to read %i bytes from GPIB device...\n", max_num_bytes);
#endif
ibtmo(gpibDevice, T10s);
ibeos(gpibDevice, 0x0);
ai = gpib_read_array(gpibDevice, max_num_bytes, segarray);
if (ai == -1) {
return 1;
}
else {
if (strcmp("HP8924C", commanalyzerType) == 0) {
segarray[ai] = 0;
*retval = atof(segarray);
}
else {
return 2;
}
}
ibtmo(gpibDevice, T10s);
#ifdef ENABLE_EXTRA_DEBUGGING
printf("[DEBG] Read %li bytes from GPIB device\n", ai);
#endif
return 0;
}
else {
return -1;
}
}
double commanalyzer_get_spectrum_analyzer_scale(double * retval, char * commanalyzerType, int gpibDevice) {
unsigned char segarray[4194304];
unsigned char floatstring[1024];
long array_pointer;
long ai;
long left_char;
long right_char;
int max_num_bytes = 0;
if ((strcmp("HP8924C", commanalyzerType) == 0)) {
// Send request
printf("[INFO] Getting spectrum analyzer scale\n\r");
if (strcmp("HP8924C", commanalyzerType) == 0) {
sprintf(falpha,"SAN:DISP:SCAL?");
#ifdef ENABLE_EXTRA_DEBUGGING
printf("[DEBG] Writing: %s\n\r", falpha);
#endif
if (gpib_write(gpibDevice, falpha) == 0) {
max_num_bytes = 24; // Request more bytes than are possible to ensure no bytes are left behind
}
else {
return 2;
}
}
// Read response
#ifdef ENABLE_EXTRA_DEBUGGING
printf("[DEBG] Trying to read %i bytes from GPIB device...\n", max_num_bytes);
#endif
ibtmo(gpibDevice, T10s);
ibeos(gpibDevice, 0x0);
ai = gpib_read_array(gpibDevice, max_num_bytes, segarray);
if (ai == -1) {
return 1;
}
else {
if (strcmp("HP8924C", commanalyzerType) == 0) {
left_char = 1;
right_char = 0;
array_pointer = 0;
for (right_char=left_char;right_char<ai;right_char++) {
if (segarray[right_char] == ' ') {
break;
}
}
strncpy(floatstring, segarray+left_char, right_char-left_char);
floatstring[right_char-left_char] = 0;
*retval = atof(floatstring);
}
else {
return 2;
}
}
ibtmo(gpibDevice, T10s);
#ifdef ENABLE_EXTRA_DEBUGGING
printf("[DEBG] Read %li bytes from GPIB device\n", ai);
#endif
return 0;
}
else {
return -1;
}
}
int commanalyzer_set_display_brightness(float percent, char * commanalyzerType, int gpibDevice) {
int instrument_scale;
if ((strcmp("HP8924C", commanalyzerType) == 0)) {
if (strcmp("HP8924C", commanalyzerType) == 0) {
instrument_scale = ((percent/100.0)*7.0)+1;
}
printf("[INFO] Setting display brightness to %d\n\r", instrument_scale);
if (strcmp("HP8924C", commanalyzerType) == 0) {
sprintf(falpha,"CONF:INT %d", instrument_scale);
#ifdef ENABLE_EXTRA_DEBUGGING
printf("[DEBG] Writing: %s\n\r", falpha);
#endif
if (gpib_write(gpibDevice, falpha) == 0) {
return 0;
}
else {
return 2;
}
}
}
else {
return 1;
}
}
double commanalyzer_get_spectrum_analyzer_center_frequency(double * retval, char * commanalyzerType, int gpibDevice) {
unsigned char segarray[4194304];
unsigned char floatstring[1024];
long array_pointer;
long ai;
long left_char;
long right_char;
int max_num_bytes = 0;
if ((strcmp("HP8924C", commanalyzerType) == 0)) {
// Send request
printf("[INFO] Getting spectrum analyzer center frequency\n\r");
if (strcmp("HP8924C", commanalyzerType) == 0) {
sprintf(falpha,"SAN:CFR?");
#ifdef ENABLE_EXTRA_DEBUGGING
printf("[DEBG] Writing: %s\n\r", falpha);
#endif
if (gpib_write(gpibDevice, falpha) == 0) {
max_num_bytes = 24; // Request more bytes than are possible to ensure no bytes are left behind
}
else {
return 2;
}
}
// Read response
#ifdef ENABLE_EXTRA_DEBUGGING
printf("[DEBG] Trying to read %i bytes from GPIB device...\n", max_num_bytes);
#endif
ibtmo(gpibDevice, T10s);
ibeos(gpibDevice, 0x0);
ai = gpib_read_array(gpibDevice, max_num_bytes, segarray);
if (ai == -1) {
return 1;
}
else {
if (strcmp("HP8924C", commanalyzerType) == 0) {
left_char = 1;
right_char = 0;
array_pointer = 0;
for (right_char=left_char;right_char<ai;right_char++) {
if (segarray[right_char] == ' ') {
break;
}
}
strncpy(floatstring, segarray+left_char, right_char-left_char);
floatstring[right_char-left_char] = 0;
*retval = atof(floatstring);
}
else {
return 2;
}
}
ibtmo(gpibDevice, T10s);
#ifdef ENABLE_EXTRA_DEBUGGING
printf("[DEBG] Read %li bytes from GPIB device\n", ai);
#endif
return 0;
}
else {
return -1;
}
}
double commanalyzer_get_spectrum_analyzer_span(double * retval, char * commanalyzerType, int gpibDevice) {
unsigned char segarray[4194304];
unsigned char floatstring[1024];
long array_pointer;
long ai;
long left_char;
long right_char;
int max_num_bytes = 0;
if ((strcmp("HP8924C", commanalyzerType) == 0)) {
// Send request
printf("[INFO] Getting spectrum analyzer frequency span\n\r");
if (strcmp("HP8924C", commanalyzerType) == 0) {
sprintf(falpha,"SAN:SPAN?");
#ifdef ENABLE_EXTRA_DEBUGGING
printf("[DEBG] Writing: %s\n\r", falpha);
#endif
if (gpib_write(gpibDevice, falpha) == 0) {
max_num_bytes = 24; // Request more bytes than are possible to ensure no bytes are left behind
}
else {
return 2;
}
}
// Read response
#ifdef ENABLE_EXTRA_DEBUGGING
printf("[DEBG] Trying to read %i bytes from GPIB device...\n", max_num_bytes);
#endif
ibtmo(gpibDevice, T10s);
ibeos(gpibDevice, 0x0);
ai = gpib_read_array(gpibDevice, max_num_bytes, segarray);
if (ai == -1) {
return 1;
}
else {
if (strcmp("HP8924C", commanalyzerType) == 0) {
left_char = 1;
right_char = 0;
array_pointer = 0;
for (right_char=left_char;right_char<ai;right_char++) {
if (segarray[right_char] == ' ') {
break;
}
}
strncpy(floatstring, segarray+left_char, right_char-left_char);
floatstring[right_char-left_char] = 0;
*retval = atof(floatstring);
}
else {
return 2;
}
}
ibtmo(gpibDevice, T10s);
#ifdef ENABLE_EXTRA_DEBUGGING
printf("[DEBG] Read %li bytes from GPIB device\n", ai);
#endif
return 0;
}
else {
return -1;
}
}

@ -47,4 +47,10 @@ int commanalyzer_spectrum_analyzer_set_generator_sweep_ascending (char * commana
int commanalyzer_spectrum_analyzer_set_generator_sweep_descending (char * commanalyzerType, int gpibDevice);
int commanalyzer_set_spectrum_analyzer_trace_averaging(float desired_avg_samples, char * commanalyzerType, int gpibDevice);
int commanalyzer_set_spectrum_analyzer_reference_power_level(float desired_reflevel, char * commanalyzerType, int gpibDevice);
int commanalyzer_get_spectrum_analyzer_number_of_vertical_divisions( char * commanalyzerType, int gpibDevice);
int commanalyzer_get_spectrum_analyzer_number_of_vertical_divisions( char * commanalyzerType, int gpibDevice);
int commanalyzer_get_spectrum_analyzer_number_of_horizontal_divisions( char * commanalyzerType, int gpibDevice);
double commanalyzer_get_spectrum_analyzer_reference_power_level (double * retval, char * commanalyzerType, int gpibDevice);
double commanalyzer_get_spectrum_analyzer_scale (double * retval, char * commanalyzerType, int gpibDevice);
double commanalyzer_get_spectrum_analyzer_center_frequency (double * retval, char * commanalyzerType, int gpibDevice);
double commanalyzer_get_spectrum_analyzer_span (double * retval, char * commanalyzerType, int gpibDevice);

@ -694,6 +694,9 @@ int mainserver(int fd) {
bytestosend = bytestosend - return_status;
k++;
}
else {
bytestosend = 0;
}
}
}
else {
@ -704,7 +707,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK", strlen("NCK"));
}
}
if (readbuf[0] == 22) { // Want to change horizontal timebase
else if (readbuf[0] == 22) { // Want to change horizontal timebase
buffer_lookfor_termdegree(readbuf, 25);
if (scope_set_timebase(atof(readbuf), scopeType, scope_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -713,7 +716,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 23) { // Want to change volts per division
else if (readbuf[0] == 23) { // Want to change volts per division
buffer_lookfor_two_termdegree(readbuf, readbuf2, 25);
if (scope_set_volts_div(atoi(readbuf), atof(readbuf2), scopeType, scope_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -722,7 +725,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 24) { // Want to change run status
else if (readbuf[0] == 24) { // Want to change run status
buffer_lookfor_termdegree(readbuf, 25);
if (scope_set_acquisition(atoi(readbuf), scopeType, scope_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -731,7 +734,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 25) { // Want to change channel enable
else if (readbuf[0] == 25) { // Want to change channel enable
buffer_lookfor_two_termdegree(readbuf, readbuf2, 25);
if (scope_set_channel_state(atoi(readbuf), atoi(readbuf2), scopeType, scope_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -740,7 +743,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 26) { // Want to change trigger channel
else if (readbuf[0] == 26) { // Want to change trigger channel
buffer_lookfor_termdegree(readbuf, 25);
if (scope_set_trigger_channel(atoi(readbuf), scopeType, scope_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -749,7 +752,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 27) { // Want to change trigger level
else if (readbuf[0] == 27) { // Want to change trigger level
buffer_lookfor_termdegree(readbuf, 25);
if (scope_set_trigger_level(atof(readbuf), scopeType, scope_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -758,7 +761,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 28) { // Want to change channel vertical position
else if (readbuf[0] == 28) { // Want to change channel vertical position
buffer_lookfor_two_termdegree(readbuf, readbuf2, 25);
if (scope_set_channel_position(atoi(readbuf), atof(readbuf2), scopeType, scope_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -784,11 +787,11 @@ int mainserver(int fd) {
quiet_write(fd, errorbuf, strlen(errorbuf));
}
}
if (readbuf[0] == 41) { // Is function generator configured?
else if (readbuf[0] == 41) { // Is function generator configured?
// If I'm in state 6 it had *better* be available!!!
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
if (readbuf[0] == 42) { // Want to change frequency
else if (readbuf[0] == 42) { // Want to change frequency
buffer_lookfor_termdegree(readbuf, 25);
if (signal_set_frequency(atof(readbuf), funcgenType, funcgen_board_device, errorbuf) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -797,7 +800,7 @@ int mainserver(int fd) {
quiet_write(fd, errorbuf, strlen(errorbuf));
}
}
if (readbuf[0] == 43) { // Want to change duty cycle
else if (readbuf[0] == 43) { // Want to change duty cycle
buffer_lookfor_termdegree(readbuf, 25);
if (signal_set_duty_cycle(atof(readbuf), funcgenType, funcgen_board_device, errorbuf) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -806,7 +809,7 @@ int mainserver(int fd) {
quiet_write(fd, errorbuf, strlen(errorbuf));
}
}
if (readbuf[0] == 44) { // Want to set square wave
else if (readbuf[0] == 44) { // Want to set square wave
if (signal_set_waveform("SQUARE", funcgenType, funcgen_board_device, errorbuf) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
@ -814,7 +817,7 @@ int mainserver(int fd) {
quiet_write(fd, errorbuf, strlen(errorbuf));
}
}
if (readbuf[0] == 45) { // Want to set sine wave
else if (readbuf[0] == 45) { // Want to set sine wave
if (signal_set_waveform("SINUSOID", funcgenType, funcgen_board_device, errorbuf) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
@ -822,7 +825,7 @@ int mainserver(int fd) {
quiet_write(fd, errorbuf, strlen(errorbuf));
}
}
if (readbuf[0] == 46) { // Want to set triangle wave
else if (readbuf[0] == 46) { // Want to set triangle wave
if (signal_set_waveform("RAMP", funcgenType, funcgen_board_device, errorbuf) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
@ -830,7 +833,7 @@ int mainserver(int fd) {
quiet_write(fd, errorbuf, strlen(errorbuf));
}
}
if (readbuf[0] == 47) { // Want to set noise wave
else if (readbuf[0] == 47) { // Want to set noise wave
if (signal_set_waveform("NOISE", funcgenType, funcgen_board_device, errorbuf) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
@ -838,7 +841,7 @@ int mainserver(int fd) {
quiet_write(fd, errorbuf, strlen(errorbuf));
}
}
if (readbuf[0] == 48) { // Want to change P-P voltage
else if (readbuf[0] == 48) { // Want to change P-P voltage
buffer_lookfor_termdegree(readbuf, 25);
if (signal_set_peak_peak_voltage(atof(readbuf), funcgenType, funcgen_board_device, errorbuf) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -847,7 +850,7 @@ int mainserver(int fd) {
quiet_write(fd, errorbuf, strlen(errorbuf));
}
}
if (readbuf[0] == 49) { // Want to change offset voltage
else if (readbuf[0] == 49) { // Want to change offset voltage
buffer_lookfor_termdegree(readbuf, 25);
if (signal_set_offset_voltage(atof(readbuf), funcgenType, funcgen_board_device, errorbuf) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -873,39 +876,46 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 41) { // Is communications analyzer configured?
else if (readbuf[0] == 41) { // Is communications analyzer configured?
// If I'm in state 7 it had *better* be available!!!
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
if ((readbuf[0] == 42)) { // Want SA trace
quiet_write(fd, "ACK", strlen("ACK"));
else if ((readbuf[0] == 42)) { // Want SA trace
quiet_write(fd, "ACK\r", strlen("ACK\r"));
fsync(fd);
if (commanalyzer_get_spectrum_analyzer_trace(commanalyzerType, commanalyzer_board_device) == 0) {
bytestosend = commanalyzerTraceLength(commanalyzerType)*sizeof(double);
int16_t numbytes = bytestosend;
quiet_write(fd, &numbytes, 2);
quiet_write(fd, "\r", 1);
fsync(fd);
k=0;
while (bytestosend > 0) {
return_status = write(fd, commanalyzer_raw_trace_data+k, 1);
return_status = write(fd, ((uint8_t*)commanalyzer_raw_trace_data)+k, 1);
if (return_status > 0) {
bytestosend = bytestosend - return_status;
k++;
}
else {
bytestosend = 0;
}
}
fsync(fd);
}
else {
quiet_write(fd, "NCK", strlen("NCK"));
}
}
if (readbuf[0] == 43) { // Want to lock screen
else if (readbuf[0] == 43) { // Want to lock screen
if (commanalyzer_lock_screen(commanalyzerType, commanalyzer_board_device) == 0) {
commanalyzer_set_display_brightness(0, commanalyzerType, commanalyzer_board_device); // Don't burn in the screen
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
else {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 44) { // Want to set generator to tracking mode
else if (readbuf[0] == 44) { // Want to set generator to tracking mode
if (commanalyzer_spectrum_analyzer_set_generator_mode_tracking(commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
@ -913,7 +923,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 45) { // Want to set generator to fixed mode
else if (readbuf[0] == 45) { // Want to set generator to fixed mode
if (commanalyzer_spectrum_analyzer_set_generator_mode_fixed(commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
@ -921,7 +931,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 46) { // Want to change center frequency
else if (readbuf[0] == 46) { // Want to change center frequency
buffer_lookfor_termdegree(readbuf, 25);
if (commanalyzer_set_spectrum_analyzer_center_frequency(atof(readbuf), commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -930,7 +940,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 47) { // Want to change frequency span
else if (readbuf[0] == 47) { // Want to change frequency span
buffer_lookfor_termdegree(readbuf, 25);
if (commanalyzer_set_spectrum_analyzer_frequency_span(atof(readbuf), commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -939,7 +949,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 48) { // Want to set RF input to dedicated connector
else if (readbuf[0] == 48) { // Want to set RF input to dedicated connector
if (commanalyzer_spectrum_analyzer_set_rf_input_dedicated(commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
@ -947,7 +957,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 49) { // Want to set RF input to multiplexed connector
else if (readbuf[0] == 49) { // Want to set RF input to multiplexed connector
if (commanalyzer_spectrum_analyzer_set_rf_input_muxed(commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
@ -955,7 +965,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 50) { // Want to set generator output to dedicated connector
else if (readbuf[0] == 50) { // Want to set generator output to dedicated connector
if (commanalyzer_spectrum_analyzer_set_generator_output_dedicated(commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
@ -963,7 +973,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 51) { // Want to set generator output to multiplexed connector
else if (readbuf[0] == 51) { // Want to set generator output to multiplexed connector
if (commanalyzer_spectrum_analyzer_set_generator_output_muxed(commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
@ -971,7 +981,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 52) { // Want to change input attenuation
else if (readbuf[0] == 52) { // Want to change input attenuation
buffer_lookfor_termdegree(readbuf, 25);
if (commanalyzer_set_spectrum_analyzer_input_attenuation(atof(readbuf), commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -980,7 +990,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 53) { // Want to change scale
else if (readbuf[0] == 53) { // Want to change scale
buffer_lookfor_termdegree(readbuf, 25);
if (commanalyzer_set_spectrum_analyzer_scale(atof(readbuf), commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -989,7 +999,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 54) { // Want to set RF input attenuator mode to automatic
else if (readbuf[0] == 54) { // Want to set RF input attenuator mode to automatic
if (commanalyzer_set_spectrum_analyzer_input_attenuator_mode_auto(commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
@ -997,7 +1007,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 55) { // Want to set RF input attenuator mode to fixed
else if (readbuf[0] == 55) { // Want to set RF input attenuator mode to fixed
if (commanalyzer_set_spectrum_analyzer_input_attenuator_mode_fixed(commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
@ -1005,7 +1015,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 56) { // Want to change generator output power
else if (readbuf[0] == 56) { // Want to change generator output power
buffer_lookfor_termdegree(readbuf, 25);
if (commanalyzer_set_spectrum_analyzer_generator_power(atof(readbuf), commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -1014,7 +1024,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 57) { // Want to change generator output frequency
else if (readbuf[0] == 57) { // Want to change generator output frequency
buffer_lookfor_termdegree(readbuf, 25);
if (commanalyzer_set_spectrum_analyzer_generator_frequency(atof(readbuf), commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -1023,7 +1033,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 58) { // Want to set generator sweep to ascending
else if (readbuf[0] == 58) { // Want to set generator sweep to ascending
if (commanalyzer_spectrum_analyzer_set_generator_sweep_ascending(commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
@ -1031,7 +1041,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 59) { // Want to set generator sweep to descending
else if (readbuf[0] == 59) { // Want to set generator sweep to descending
if (commanalyzer_spectrum_analyzer_set_generator_sweep_descending(commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
@ -1039,7 +1049,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 60) { // Want to set trace averaging
else if (readbuf[0] == 60) { // Want to set trace averaging
buffer_lookfor_termdegree(readbuf, 25);
if (commanalyzer_set_spectrum_analyzer_trace_averaging(atof(readbuf), commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -1048,7 +1058,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 61) { // Want to set reference power level
else if (readbuf[0] == 61) { // Want to set reference power level
buffer_lookfor_termdegree(readbuf, 25);
if (commanalyzer_set_spectrum_analyzer_reference_power_level(atof(readbuf), commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, "ACK\r", strlen("ACK\r"));
@ -1057,7 +1067,7 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
if (readbuf[0] == 62) { // Want the number of vertical divisions available
else if (readbuf[0] == 62) { // Want the number of vertical divisions available
int16_t divisions = commanalyzer_get_spectrum_analyzer_number_of_vertical_divisions(commanalyzerType, commanalyzer_board_device);
if (divisions >= 0) {
quiet_write(fd, &divisions, 2);
@ -1067,6 +1077,72 @@ int mainserver(int fd) {
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
else if (readbuf[0] == 63) { // Want the number of samples in a trace
int16_t divisions = commanalyzerTraceLength(commanalyzerType);
if (divisions >= 0) {
quiet_write(fd, &divisions, 2);
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
else {
quiet_write(fd, &divisions, 2);
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
else if (readbuf[0] == 64) { // Want the number of horizontal divisions available
int16_t divisions = commanalyzer_get_spectrum_analyzer_number_of_horizontal_divisions(commanalyzerType, commanalyzer_board_device);
if (divisions >= 0) {
quiet_write(fd, &divisions, 2);
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
else {
quiet_write(fd, &divisions, 2);
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
else if (readbuf[0] == 65) { // Want the reference power level
double rpower;
if (commanalyzer_get_spectrum_analyzer_reference_power_level(&rpower, commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, &rpower, sizeof(double));
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
else {
quiet_write(fd, &rpower, sizeof(double));
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
else if (readbuf[0] == 66) { // Want the vertical division scale
double scale;
if (commanalyzer_get_spectrum_analyzer_scale(&scale, commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, &scale, sizeof(double));
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
else {
quiet_write(fd, &scale, sizeof(double));
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
else if (readbuf[0] == 67) { // Want to get the center frequency
double freq;
if (commanalyzer_get_spectrum_analyzer_center_frequency(&freq, commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, &freq, sizeof(double));
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
else {
quiet_write(fd, &freq, sizeof(double));
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
else if (readbuf[0] == 68) { // Want to get the frequency span
double freq;
if (commanalyzer_get_spectrum_analyzer_span(&freq, commanalyzerType, commanalyzer_board_device) == 0) {
quiet_write(fd, &freq, sizeof(double));
quiet_write(fd, "ACK\r", strlen("ACK\r"));
}
else {
quiet_write(fd, &freq, sizeof(double));
quiet_write(fd, "NCK\r", strlen("NCK\r"));
}
}
}
break;
case 2: // Open the serial port
@ -1114,6 +1190,9 @@ int main(int argc, char *argv[])
server_multiplexer.tv_sec = 0;
server_multiplexer.tv_usec = 10;
// Register signal handler
signal(SIGPIPE, signal_handler_IO);
printf("RemoteFPGA GPIB Server v%s.%s%s\n\r", SERVER_MAJOR, SERVER_MINOR, SERVER_REVISION);
printf("(c) %s Timothy Pearson\n\r", COPYRIGHT_DATE);
printf("(c) %s Remote Laboratory FOSS Contributors\n\r", FOSS_COPYRIGHT_DATE);

Loading…
Cancel
Save