all.pro 0000644 0002101 0021616 00000001455 12316530537 011230 0 ustar mezger sls _QTHOME=$$(QTHOME)
_QWTHOME=$$(QWTHOME)
_EPICSBASE=$$(EPICS_BASE)
isEmpty(_QTHOME){
message("QTHOME must be defined in order to locate QT")
error(please define QTHOME.)
}else{
message("QT located in $$_QTHOME")
}
isEmpty(_QWTHOME){
message("QWTHOME must be defined in order to locate QWT")
error(please define QWTHOME.)
}else{
message("qwt located in $$_QWTHOME")
}
isEmpty(_EPICSBASE){
message("EPICS_BASE must be defined in order to use EPICS")
error(please define EPICS_BASE.)
}else{
message("EPICS located in $$_EPICSBASE")
}
#version check qt
contains(QT_VERSION, ^4\\.[0-5]\\..*) {
message("Cannot build package with Qt version $${QT_VERSION}.")
error("Use at least Qt 4.6.")
}
TEMPLATE = subdirs
SUBDIRS = caQtDM_QtControls caQtDM_Lib caQtDM_Viewer
win32{
CONFIG(debug, debug | release)
}
COPYING 0000644 0002101 0021616 00000104473 12231214467 010772 0 ustar mezger sls GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. 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
them 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 prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. 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.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey 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;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If 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 convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU 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 that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
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.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
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.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
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
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 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, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program 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, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
. caQtDM_README 0000644 0002101 0021616 00000012111 12206657117 012000 0 ustar mezger sls Instructions for installing and running caQtDM on linux
Requirements:
1) Qt 4.8.2
2) Qwt 6.0.1
3) EPICS 3.12.2
4) Designer
or
1) Qt 5.1
2) Qwt 6.1.0
3) EPICS 3.12.2
4) Designer
1. what is caQTDM: caQtDM offers a collection of special widgets in order to display and control control system data in various ways. The widgets have been inspired from the well known MEDM package used
at many EPICS sites. However caQtDM is not restricted to EPICS and can/could also support other control systems. At PSI caQtDM is used at several facilities and controls not only EPICS, but also simultanuously
an older house-made system. Moreover support has already been introduced for EPICS4, but is still in development.
2. how to use it: in case of existing MEDM files, these can be translated to Qt xml files by using the utility adl2ui contained in the package. Normally nothing will have to be changed in the resulting files, but in case of small problems, like for instance in overlapping order, the Qt4-designer can be used to correct these. However when you start from scratch, you will develop your screens with the Qt4-designer and display them by the caQtDM utility, which takes care of the data acquisition/control and the display. The conventions for the widgets and channels are fully compatible with MEDM and some other widgets have been added. The MEDM manual will give you normally all the necessary explanations for the different widgets while the mechanisms are the same. However you will have to get accustomed with the Qt4-designer utility and a quick look at its manual delivered with it, should give you an idea.
3. how to install it: the latest version of caQtDM 3.1.4 has now a new build and installation procedure working for several linux platforms. First you will have to unpack the tar archive, which will create the nessary directories and files. In the upper directory you will find the necessary procedures to build the package, run it locally without installing and also an installtion procedure.
1. you will have to install Qt-4.8 and qwt-6 when they are not already installed. On modern systems Qt4 should already be installed, but the qt4-designer not necessarily and you should install it (eventually with sudo apt-get install qt4-designer). qwt is normally not installed and you should install this too.
2. you will have to install EPICS
3. all the environment variables used for the installation will be defined in the script caQtDM_Env. When some of the variables are already defined in your environment, the script will use them, otherwise they will be defined. It is up to you to edit this file and adapt the variables to your environment.
4. the script caQtDM_BuildAll will build you the package now into the directory ./caQtDM_Binaries. You should obtain there adl2ui, caQtDM, libqtcontrols.so and libcaQtDM_Lib.so as well as a designer directory containing 3 files libqtcontrols*_plugin.so. if you encounter a problem when building due to some environment variable problem or while not everything was installed before, you may correct your problem and run the script again. In case you want to cleanup you use the script caQtDM_CleanAll, which will also delete the resulting binaries.
5. you may try to install the package: the package should normally be installed in the EPICS extensions and the environment variables are pointing to them.
4. running caQtDM: when the package has been successfully build into the directory ./caQtDM_Binaries, you can start caQtDM by using the script startDM_Local
and the qt4-designer by the script qtdesigner (all located in the main directory where you expanded the tar file). These scripts will set some important environment variables in order to set the path, the plugin_path and to point to the test directory provided with the package (./caQtDM_Tests). In this directory also the stylesheets are located to be used for a nice rendering. You may call the test.ui file with the above mentioned scripts. In order to test the display some EPICS channels have to be defined. This can be done by running a soft-ioc shell called with run-epics also provided in the test directory.
5. in case you have qwt 6.1 you will have to use in caQtDM_QtControls/src the files qwt_thermo_marker_61.* instead of qwt_thermo_marker.*
6. in case you already use Qt5.1 with qwt6.1 the building should also be straight forward.
good luck and enjoy
in case of problems, please contact Anton Mezger at PSI.
====================================================================================================================================================================
Instructions for compiling caQtDM on Windows
Requirements:
1) Qt 4.8.2
2) Qwt 6.0.1
3) EPICS 3.12.2
4) MS Visual Studio 2010
5) Wix 3.0.5419.0
With caQtDM_Env.bat you can configure your system. All setting which are needed will be taken from here.
The building can be started with the batchfile : caQtDM_BuildAll.bat
The packaging is made with the batch file : caQtDM_Build_Package.bat
This will generate a MSI installation file in the folder of caQtDM_Binaries.
To clean the Folder you should use caQtDM_CleanAll.bat.
caQtDM_BuildAll 0000755 0002101 0021616 00000001340 12315302332 012523 0 ustar mezger sls #!/bin/bash
source caQtDM_Env
echo
echo ========== create destination directory if not exists============
echo
if [ -d "./caQtDM_Binaries" ]; then
echo directory ./caQtDM_Binaries exists already
else
echo create directory ./caQtDM_Binaries
mkdir -p ./caQtDM_Binaries
fi
if [ -d "./caQtDM_Binaries/designer" ]; then
echo directory ./caQtDM_Binaries/designer exists already
else
echo create directory ./caQtDM_Binaries/designer
mkdir -p ./caQtDM_Binaries/designer
fi
echo package will be build in ./caQtDM_Binaries
echo
read -p "Press [Enter] key to start build "
echo ============ make all =================
qmake all.pro
make
echo =========== build plugins =============
cd caQtDM_QtControls/plugins/
./linuxbuild;
cd ..; cd ..
caQtDM_CleanAll 0000755 0002101 0021616 00000001703 12323744677 012536 0 ustar mezger sls #!/bin/bash
source caQtDM_Env
echo package will be removed from ./caQtDM_Binaries and all directories will be cleaned up
read -p "Press [Enter] key to start cleanup "
echo ========== remove binaries from directories ============
if [ -d "./caQtDM_Binaries" ]; then
rm -rf ./caQtDM_Binaries/*
fi
echo ========== remove makefiles from directories ============
rm -f Makefile
rm -f ./caQtDM_Viewer/Makefile
rm -f ./caQtDM_Viewer/caQtDM1/Makefile
rm -f ./caQtDM_Viewer/caQtDM2/Makefile
rm -f ./caQtDM_Viewer/parser/Makefile
rm -f ./caQtDM_Lib/Makefile
rm -f ./caQtDM_Lib/caQtDM_Lib1/Makefile
rm -f ./caQtDM_Lib/caQtDM_Lib2/Makefile
rm -f ./caQtDM_QtControls/Makefile
rm -f ./caQtDM_QtControls/plugins/Makefile
rm -f ./caQtDM_Lib/*.so
rm -f ./caQtDM_QtControls/*.so
rm -f ./caQtDM_QtControls/plugins/*.so
rm -f ./caQtDM_QtControls/plugins/moc/*
rm -f ./caQtDM_QtControls/plugins/obj/*
echo =========== clean all ==================
qmake all.pro
make distclean
caQtDM_Env 0000755 0002101 0021616 00000006103 12351771103 011573 0 ustar mezger sls #!/bin/bash
if [ -z "$QTHOME" ]; then export QTHOME=/usr;
fi
if [ -z "$QWTHOME" ]; then export QWTHOME=/usr;
fi
if [ -z "$QWTINCLUDE" ]; then export QWTINCLUDE=/usr/include/qwt;
fi
if [ -z "$QWTLIB" ]; then export QWTLIB=${QWTHOME}/lib;
fi
if [ -z "$EPICS_BASE" ]; then export EPICS_BASE=/usr/local/epics/base;
fi
if [ -z "$EPICSINCLUDE" ]; then export EPICSINCLUDE=${EPICS_BASE}/include;
fi
if [ -z "$EPICSLIB" ]; then export EPICSLIB=${EPICS_BASE}/lib/$EPICS_HOST_ARCH;
fi
if [ -z "$EPICSEXTENSIONS" ]; then export EPICSEXTENSIONS=/usr/local/epics/extensions;
fi
if [ -z "$QTCONTROLS_LIBS" ]; then export QTCONTROLS_LIBS=`pwd`/caQtDM_Binaries;
fi
export QTBASE=${QTCONTROLS_LIBS};
if [ -z "$QTDM_LIBINSTALL" ]; then export QTDM_LIBINSTALL=$EPICSEXTENSIONS/lib/$EPICS_HOST_ARCH;
fi
if [ -z "$QTDM_BININSTALL" ]; then export QTDM_BININSTALL=$EPICSEXTENSIONS/bin/$EPICS_HOST_ARCH;
fi
if [ -z "$TROLLTECH" ]; then
echo
echo ====== do not use psi trolltech directories
echo
if [ -z "$QTDM_RPATH" ]; then export QTDM_RPATH=${QTDM_LIBINSTALL}:$TROLLTECH/binQt:${QTBASE};
fi
else
echo
echo ====== use psi trolltech directories
echo
if [ -z "$QTDM_RPATH" ]; then export QTDM_RPATH=${QTDM_LIBINSTALL}:$TROLLTECH/binQt;
fi
fi
if [ -z "$QTDM_RPATH" ]; then export QTDM_RPATH=${QTDM_LIBINSTALL}:$TROLLTECH/binQt:${QTBASE};
fi
echo =============================================================================================
echo in order to build this package you will eventually have to redefine following variables in
echo this file, they are taken from your environment if they exist, otherwise define them yourself:
echo
echo for building:
echo
echo QTHOME now defined as ${QTHOME} for locating Qt
echo QWTHOME now defined as ${QWTHOME} for locating qwt
echo QWTINCLUDE now defined as ${QWTINCLUDE} for locating the include files of qwt
echo QWTLIB now defined as ${QWTLIB} for locating the libraries of qwt
echo EPICS_BASE now defined as ${EPICS_BASE} for locating epics
echo EPICSINCLUDE now defined as ${EPICSINCLUDE} for locating epics include files
echo EPICSLIB now defined as ${EPICSLIB} for locating epics libraries
echo QTBASE now defined as ${QTBASE} for building the package locally, pointing to caQtDM_Binaries
echo QTDM_RPATH now defined as ${QTDM_RPATH} for runtime search path
echo
echo for install:
echo
echo EPICSEXTENSIONS now defined as ${EPICSEXTENSIONS} for locating epics extensions
echo QTDM_LIBINSTALL now defined as ${QTDM_LIBINSTALL} for libraries install
echo QTDM_BININSTALL now defined as ${QTDM_BININSTALL} for binaries install
echo ============================================================================================
echo
caQtDM_Install 0000755 0002101 0021616 00000002322 12315302332 012442 0 ustar mezger sls #!/bin/bash
echo $PWD
source $PWD/caQtDM_Env
echo =============================================================================================
echo
echo binaries will be installed in ${QTDM_BININSTALL}
echo libraries will be installed in ${QTDM_LIBINSTALL}
echo plugins will be installed in ${QTDM_LIBINSTALL}/designer
echo " "
read -p "Press [Enter] key to start build "
echo " "
mkdir -p ${QTDM_LIBINSTALL}/designer
cp -v caQtDM_Binaries/caQtDM ${QTDM_BININSTALL}/
cp -v caQtDM_Binaries/adl2ui ${QTDM_BININSTALL}/
cp -v caQtDM_Binaries/libcaQtDM_Lib.so ${QTDM_LIBINSTALL}/
cp -v caQtDM_Binaries/libqtcontrols.so ${QTDM_LIBINSTALL}/
cp -v caQtDM_Binaries/designer/libqtcontrols_*_plugin.so ${QTDM_LIBINSTALL}/designer/
cp -v startDM ${QTDM_BININSTALL}/
echo ""
echo "Put these in your .profile"
echo "export QT_PLUGIN_PATH=${QTDM_LIBINSTALL}"
echo " "
echo "and execute 'designer' for building GUI's, 'adl2ui' for converting medm files, 'startDM' to execute caQtDM"
echo "you may try the test files located in caQtDM_Tests (set CAQTDM_DISPLAY_PATH accordingly)"
echo "you may try also to execute the command 'run-epics' in caQtDM_Tests (will setup a softioc) to get the channels"
echo "used by the test."
echo " "
caQtDM_Viewer/ 0000755 0002101 0021616 00000000000 12401341006 012345 5 ustar mezger sls caQtDM_Viewer/WinQtDM_Hipa.bat 0000644 0002101 0021616 00000001257 12315302333 015272 0 ustar mezger sls echo on
echo Setting up environment for Qt usage...
set QTDIR=C:\QtSDK\Desktop\Qt\4.8.1\mingw
set PATH=C:\epics\base-3.14.12\bin\win32-x86-mingw;%PATH%
set PATH=%QTDIR%\bin;%PATH%
set PATH=C:\QtSDK\mingw\bin;%PATH%
set PATH=c:\work\caQtDM;%PATH%
set PATH=C:\work\caQtDM_Lib\release;%PATH%
set PATH=C:\work\caQtDM\release;%PATH%
set PATH=C:\work\QtControls\qtcontrols\release;%PATH%
set PATH=C:\Qwt-6.0.1\lib;%PATH%
set EPICS_CA_MAX_ARRAY_BYTES=40000000
set EPICS_CA_ADDR_LIST=hipa-cagw01.psi.ch
set EPICS_CA_SERVER_PORT=5062
set EPICS_CA_AUTO_ADDR_LIST=NO
echo "EPICS Channel Access is to the hipa Network"
cd \work\caQtDM\parser\hipaFiles
start /wait caQtDM caQtDM_Viewer/WinQtDM_Office.bat 0000644 0002101 0021616 00000001405 12315302333 015577 0 ustar mezger sls echo on
echo Setting up environment for Qt usage...
set QTDIR=C:\QtSDK\Desktop\Qt\4.8.1\mingw
set PATH=C:\epics\base-3.14.12\bin\win32-x86-mingw;%PATH%
set PATH=%QTDIR%\bin;%PATH%
set PATH=C:\QtSDK\mingw\bin;%PATH%
set PATH=c:\work\caQtDM;%PATH%
set PATH=C:\work\caQtDM_Lib\release;%PATH%
set PATH=C:\work\caQtDM\release;%PATH%
set PATH=C:\work\QtControls\qtcontrols\release;%PATH%
set PATH=C:\Qwt-6.0.1\lib;%PATH%
cd \work\caQtDM\parser\proscanFiles
set EPICS_CA_AUTO_ADDR_LIST=NO
set EPICS_CA_MAX_ARRAY_BYTES=40000000
set CAO_CA_ADDR_LIST="129.129.145.105 129.129.130.255 129.129.131.255 129.129.137.255"
set EPICS_CA_ADDR_LIST=129.129.145.105 proscan-cagw01:5062
echo "EPICS Channel Access is to the office Network"
start /wait caQtDM tests.ui caQtDM_Viewer/WinQtDM_Pro.bat 0000644 0002101 0021616 00000001277 12315302333 015153 0 ustar mezger sls echo on
echo Setting up environment for Qt usage...
set QTDIR=C:\QtSDK\Desktop\Qt\4.8.1\mingw
set PATH=C:\epics\base-3.14.12\bin\win32-x86-mingw;%PATH%
set PATH=%QTDIR%\bin;%PATH%
set PATH=C:\QtSDK\mingw\bin;%PATH%
set PATH=c:\work\caQtDM;%PATH%
set PATH=C:\work\caQtDM_Lib\release;%PATH%
set PATH=C:\work\caQtDM\release;%PATH%
set PATH=C:\work\QtControls\qtcontrols\release;%PATH%
set PATH=C:\Qwt-6.0.1\lib;%PATH%
cd \work\caQtDM\parser\proscanFiles
set EPICS_CA_MAX_ARRAY_BYTES=40000000
set EPICS_CA_ADDR_LIST=proscan-cagw01.psi.ch
set EPICS_CA_SERVER_PORT=5062
set EPICS_CA_AUTO_ADDR_LIST=NO
echo "EPICS Channel Access is to the proscan Network"
start /wait caQtDM tests.ui caQtDM_Viewer/comet.ui 0000644 0002101 0021616 00000334051 12364377674 014055 0 ustar mezger sls
MainWindow
0
0
1200
770
QWidget#centralWidget {background: rgb(200, 200, 200);}
caTable {
background: cornsilk;
alternate-background-color: wheat;
}
caLineEdit {
border-radius: 1px;
background: lightyellow;
color: black;
}
caTextEntry {
color: rgb(127, 0, 63);
background-color: cornsilk;
selection-color: #0a214c;
selection-background-color: wheat;
border: 1px groove black;
border-radius: 1px;
padding: 1px;
}
caTextEntry:focus {
padding: 0px;
border: 2px groove darkred;
border-radius: 1px;
}
QPushButton {
border-color: #00b;
border-radius: 2px;
padding: 3px;
border-width: 1px;
background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,
stop:0 rgba(224, 239, 255, 255),
stop:0.5 rgba(199, 215, 230, 255),
stop:1 rgba(184, 214, 236, 255));
}
QPushButton:hover {
background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,
stop:0 rgba(201, 226, 255, 255),
stop:0.5 rgba(177, 204, 230, 255),
stop:1 rgba(163, 205, 236, 255));
}
QPushButton:pressed {
background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,
stop:0 rgba(174, 219, 255, 255),
stop:0.5 rgba(165, 199, 230, 255),
stop:1 rgba(134, 188, 236, 255));
}
QPushButton:disabled {
background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,
stop:0 rgba(174, 219, 255, 255),
stop:0.5 rgba(165, 199, 230, 255),
stop:1 rgba(134, 188, 236, 255));
}
caChoice {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
}
caSlider::groove:horizontal {
border: 1px solid #bbb;
background: lightgrey;
height: 20px;
border-radius: 4px;
}
caSlider::handle:horizontal {
background: red;
border: 1px solid #777;
width: 13px;
margin-top: -2px;
margin-bottom: -2px;
border-radius: 2px;
}
752
95
435
365
218
218
218
caGraphics::Solid
caGraphics::Filled
218
218
218
caGraphics::Rectangle
600
95
160
365
218
218
218
caGraphics::Solid
caGraphics::Filled
218
218
218
caGraphics::Rectangle
171
95
422
365
218
218
218
caGraphics::Solid
caGraphics::Filled
218
218
218
caGraphics::Rectangle
14
93
147
365
218
218
218
caGraphics::Solid
caGraphics::Filled
218
218
218
caGraphics::Rectangle
210
466
150
180
0
213
255
caGraphics::Solid
caGraphics::Filled
42
99
228
caGraphics::Rectangle
10
11
220
20
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
XPROSCAN:TIME:2
0
0
0
200
200
200
caLineEdit::Static
caLineEdit::Channel
caLineEdit::Channel
1.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
caLineEdit::decimal
570
15
220
28
QFrame::NoFrame
PROSCAN COMET
Qt::AlignAbsolute|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
400
466
161
22
QFrame::NoFrame
Ionenquelle
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
590
466
161
22
QFrame::NoFrame
HF nicht reduziert
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
970
466
161
22
QFrame::NoFrame
Ablenkplatte
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
180
430
120
26
Injektion
0
0
0
187
193
135
injection
comet_injection.adl
caRowColMenu::Menu
913
422
120
26
Extraktion
0
0
0
187
193
135
extraction
comet_extraction.adl
caRowColMenu::Menu
255
475
66
22
QFrame::NoFrame
Reset
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
160
160
164
205
97
0
217
503
130
130
CMJIM:COM:2
caChoice::Static
26
513
100
60
CMJIM:COMX:2
caChoice::Static
20
473
120
110
0
213
255
caGraphics::Solid
caGraphics::Filled
42
99
228
caGraphics::Rectangle
50
485
61
22
QFrame::NoFrame
Zugriff
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
160
160
164
1050
70
101
22
QFrame::NoFrame
Steerer
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
770
70
261
22
QFrame::NoFrame
Extractor (Deflektor 1 + 2)
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
340
205
111
22
QFrame::NoFrame
V.Deflektor
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
200
70
111
22
QFrame::NoFrame
Ionenquelle
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
375
70
191
22
QFrame::NoFrame
Phasenspalt 1 + 2
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
610
70
121
22
QFrame::NoFrame
HF-Leistung
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
610
140
101
21
QFrame::NoFrame
HF-Solenoid
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
25
70
131
22
QFrame::NoFrame
Hauptmagnet
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
17
356
142
96
0
0
140
28
Magnet
0
0
0
187
193
135
magnet
comet_magnet.adl
caRowColMenu::Menu
0
66
140
28
Kryogenie
0
0
0
187
193
135
kryo
comet_kryo.adl
caRowColMenu::Menu
0
33
140
28
Kräfte
0
0
0
187
193
135
Spule
comet_spule.adl
caRowColMenu::Menu
1049
101
135
25
0
0
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
130
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
SMJ1X:IST:2
82
218
59
0
0
0
caLineEdit::Alarm_Static
2
caLineEdit::User
caLineEdit::Channel
0.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
1049
129
135
25
0
0
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
130
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
SMJ2Y:IST:2
82
218
59
0
0
0
caLineEdit::Alarm_Static
2
caLineEdit::User
caLineEdit::Channel
0.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
900
129
140
25
0
0
138
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
135
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
IMJGOF2:IST:2
255
255
255
0
0
0
caLineEdit::Alarm_Static
2
caLineEdit::User
caLineEdit::Channel
0.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
901
100
138
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
903
102
135
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
EMJEC2V:IST:2
255
255
255
0
0
0
caLineEdit::Alarm_Static
2
caLineEdit::User
caLineEdit::Channel
51.000000000000000
46.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
754
129
138
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
756
131
135
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
IMJGOF1:IST:2
255
255
255
0
0
0
caLineEdit::Alarm_Static
2
caLineEdit::User
caLineEdit::Channel
51.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
606
101
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
608
103
130
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
CMJSEV:PWRF:2
255
255
255
0
0
0
caLineEdit::Alarm_Static
2
caLineEdit::User
caLineEdit::Channel
120.000000000000000
100.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
606
167
135
25
0
0
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
130
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
WMJ:IST:2
255
255
255
0
0
0
caLineEdit::Alarm_Static
2
caLineEdit::User
caLineEdit::Channel
10.000000000000000
9.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
456
101
135
25
0
0
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
130
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
FMJIPI:BREI:2
82
218
59
0
0
0
caLineEdit::Alarm_Static
2
caLineEdit::User
caLineEdit::Channel
0.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
456
129
135
25
0
0
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
130
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
FMJIPI:POS:2
82
218
59
0
0
0
caLineEdit::Alarm_Static
2
caLineEdit::User
caLineEdit::Channel
0.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
318
101
135
25
0
0
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
130
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
FMJEPI:BREI:2
82
218
59
0
0
0
caLineEdit::Alarm_Static
2
caLineEdit::User
caLineEdit::Channel
0.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
318
129
135
25
0
0
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
130
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
FMJEPI:POS:2
82
218
59
0
0
0
caLineEdit::Alarm_Static
2
caLineEdit::User
caLineEdit::Channel
0.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
174
129
140
25
0
0
138
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
135
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
IMJGF:IST:2
255
255
255
0
0
0
caLineEdit::Alarm_Static
2
caLineEdit::User
caLineEdit::Channel
0.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
174
158
140
25
0
0
138
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
135
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
IMJI:IST:2
255
255
255
0
0
0
caLineEdit::Alarm_Static
1
caLineEdit::User
caLineEdit::Channel
600.000000000000000
20.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
24
101
135
25
0
0
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
130
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
AMJHS-I:IADC:2
255
255
255
0
0
0
caLineEdit::Alarm_Static
3
caLineEdit::Channel
caLineEdit::User
160.000000000000000
158.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
174
101
140
25
0
0
138
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
135
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
IMJV:IST:2
82
218
59
0
0
0
caLineEdit::Alarm_Static
2
caLineEdit::User
caLineEdit::Channel
0.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
754
101
138
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
756
103
135
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
EMJEC1V:IST:2
255
255
255
0
0
0
caLineEdit::Alarm_Static
2
caLineEdit::User
caLineEdit::Channel
51.000000000000000
46.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
754
157
420
250
HF & Deflektors
CMJSEV:PWRF:2;EMJEC1V:IST:2;EMJEC2V:IST:2
caStripPlot::Minute
5.000000000000000
120.000000000000000
0.000000000000000
caStripPlot::User
caStripPlot::User
253
0
0
60.000000000000000
0.000000000000000
caStripPlot::User
caStripPlot::User
251
243
74
60.000000000000000
0.000000000000000
caStripPlot::User
caStripPlot::User
153
255
255
0
0
0
0
0
0
255
255
255
180
230
401
196
Ablenkplatte + MMAC3
EMJCYV:IST:2;MMAC3:STR:2
caStripPlot::Minute
5.000000000000000
5.000000000000000
0.000000000000000
caStripPlot::User
caStripPlot::User
253
0
0
50.000000000000000
0.000000000000000
caStripPlot::User
caStripPlot::User
251
243
74
0
0
0
0
0
0
218
218
218
780
466
161
22
QFrame::NoFrame
Hochfrequenz
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
455
205
135
25
0
0
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
130
22
0
0
130
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
EMJCYV:IST:2
82
218
59
0
0
0
caLineEdit::Alarm_Static
2
caLineEdit::User
caLineEdit::Channel
1.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
25
155
136
22
QFrame::NoFrame
Extrakt.phase
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
22
180
135
25
0
0
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
130
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
MMJF:IST:2
0
0
0
218
218
218
caLineEdit::Static
1
caLineEdit::User
caLineEdit::User
0.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
400
623
772
123
190
0
160
76
UMJSSB:BHR:1:SBNT
UMJSSB:BHR:1
4
7
238
182
43
255
0
0
ESimpleLabel::WidthAndHeight
190
100
160
21
UMJSSB:BHRX:1:SBNT
UMJSSB:BHRX:1
3
3
0
255
0
255
0
0
ESimpleLabel::WidthAndHeight
0
0
160
96
UMJSSB:BIQ:1:SBNT
UMJSSB:BIQ:1
5
9
238
182
43
255
0
0
ESimpleLabel::WidthAndHeight
0
100
160
21
UMJSSB:BIQX:1:SBNT
UMJSSB:BIQX:1
3
3
0
255
0
255
0
0
ESimpleLabel::WidthAndHeight
380
0
160
96
UMJSSB:BHF:1:SBNT
UMJSSB:BHF:1
5
9
238
182
43
255
0
0
ESimpleLabel::WidthAndHeight
380
100
160
21
UMJSSB:BHFX:1:SBNT
UMJSSB:BHFX:1
3
3
0
255
0
255
0
0
ESimpleLabel::WidthAndHeight
570
0
160
76
UMJSSB:BDE:1:SBNT
UMJSSB:BDE:1
4
7
238
182
43
255
0
0
ESimpleLabel::WidthAndHeight
570
100
160
21
UMJSSB:BDEX:1:SBNT
UMJSSB:BDEX:1
3
3
0
255
0
255
0
0
ESimpleLabel::WidthAndHeight
611
356
142
94
0
0
140
26
HF
0
0
0
187
193
135
HF
comet_hf.adl
caRowColMenu::Menu
0
33
140
26
Trimrods A.
0
0
0
187
193
135
trimrods
comet_trimaussen.adl
caRowColMenu::Menu
0
66
140
26
Trimrods I.
0
0
0
187
193
135
trimrods
comet_triminnen.adl
caRowColMenu::Menu
590
490
160
86
UMJSSB:BHR:1:SBNT
UMJSSB:BHR:1
3
0
255
0
255
0
0
ESimpleLabel::WidthAndHeight
590
575
160
41
UMJSSB:BHR:1:SBNT
UMJSSB:BHR:1
8
9
0
255
0
255
0
0
ESimpleLabel::WidthAndHeight
20
235
135
25
0
0
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
130
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
MMAC3:STR:2
0
0
0
218
218
218
caLineEdit::Static
1
caLineEdit::User
caLineEdit::User
0.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
25
210
121
22
QFrame::NoFrame
Beam current
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
20
290
130
21
XPROSCAN:STAB:2
25
265
106
22
QFrame::NoFrame
Mastership
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
400
490
160
106
UMJSSB:BIQ:1:SBNT
UMJSSB:BIQ:1
4
0
255
0
255
0
0
ESimpleLabel::WidthAndHeight
780
490
160
106
UMJSSB:BHF:1:SBNT
UMJSSB:BHF:1
4
0
255
0
255
0
0
ESimpleLabel::WidthAndHeight
970
490
160
86
UMJSSB:BDE:1:SBNT
UMJSSB:BDE:1
3
0
255
0
255
0
0
ESimpleLabel::WidthAndHeight
320
160
131
41
FMJEP:STAX:1:SBNT
FMJEP:STAX:1
6
7
238
182
43
179
179
179
ESimpleLabel::WidthAndHeight
460
160
131
41
FMJIP:STAX:1:SBNT
FMJIP:STAX:1
6
7
238
182
43
179
179
179
ESimpleLabel::WidthAndHeight
20
610
160
86
CMJIM:STAX:1:SBNT
CMJIM:STAX:1
12
15
255
0
0
0
255
0
ESimpleLabel::WidthAndHeight
320
430
120
26
Ionenquelle
0
0
0
187
193
135
Ionenquelle
ACCEL_IQ.ui
caRowColMenu::Menu
460
430
120
26
Vertikal Defl.
0
0
0
187
193
135
Vertikal Defl.
ACCEL_VD.ui
caRowColMenu::Menu
caRectangle_0
caRectangle_1
caRectangle_2
caRectangle_3
caRectangle_4
caLineEdit_0
caLabel_0
caLabel_1
caLabel_2
caLabel_3
caRelatedDisplay_0
caRelatedDisplay_1
caLabel_4
caChoice_0
caRectangle_5
caLabel_5
caLabel_6
caLabel_7
caLabel_8
caLabel_9
caLabel_10
caLabel_11
caLabel_12
caLabel_13
caFrame_0
caFrame_1
caFrame_2
caFrame_3
caRectangle_9
caLineEdit_8
caRectangle_10
caLineEdit_10
caRectangle_11
caLineEdit_12
caFrame_4
caFrame_5
caFrame_6
caFrame_7
caFrame_8
caFrame_9
caFrame_10
caFrame_11
caFrame_12
caRectangle_21
caLineEdit_32
caStripPlot_0
caStripPlot_1
caLabel_14
caFrame_13
caLabel_15
caFrame_15
caFrame_16
caFrame_17
cabitnames_2
cabitnames_3
caFrame_18
caLabel_16
mastershipValueLine
caLabel_17
cabitnames_6
cabitnames_9
cabitnames_12
cabitnames_15
cabitnames_16
cabitnames_4
caChoice_1
caRelatedDisplay_8
caRelatedDisplay_9
caChoice
QWidget
caRelatedDisplay
QWidget
caFrame
QFrame
1
caLabel
QLabel
caGraphics
QWidget
caLineEdit
QLineEdit
caStripPlot
QFrame
caBitnames
QWidget
caQtDM_Viewer/caQtDM1/ 0000755 0002101 0021616 00000000000 12401341006 013537 5 ustar mezger sls caQtDM_Viewer/caQtDM1/caQtDM1.pro 0000644 0002101 0021616 00000002702 12360010537 015462 0 ustar mezger sls include (../caQtDM.pri)
TARGET = caQtDM
TEMPLATE = app
# static build
ios {
CONFIG += staticlib
LIBS += ../../caQtDM_Binaries/libcaQtDM_Lib.a
LIBS += ../../caQtDM_Binaries/libqtcontrols.a
LIBS += $$(QWTHOME)/lib/libqwt.a
LIBS += ../../caQtDM_Binaries/libqtcontrols_controllers_plugin.a
LIBS += ../../caQtDM_Binaries/libqtcontrols_monitors_plugin.a
LIBS += ../../caQtDM_Binaries/libqtcontrols_graphics_plugin.a
LIBS += $$(EPICSLIB)/libca.a
LIBS += $$(EPICSLIB)/libCom.a
#QMAKE_INFO_PLIST = ../src/Info.plist
ICON = ../src/caQtDM.icns
}
!ios {
LIBS += -L$(QTBASE) -Wl,-rpath,$(QTDM_RPATH) -lcaQtDM_Lib
unix:!macx {
QMAKE_POST_LINK = cp ../caQtDM $(QTBASE)
}
macx: {
QMAKE_INFO_PLIST = ../src/Info.plist
QMAKE_POST_LINK += cp -R ../caQtDM.app ../../caQtDM_Binaries/ &&
QMAKE_POST_LINK += cp ../../caQtDM_Binaries/libcaQtDM_Lib.dylib ../../caQtDM_Binaries/caQtDM.app/Contents/Frameworks &&
QMAKE_POST_LINK += cp ../../caQtDM_Binaries/libqtcontrols.dylib ../../caQtDM_Binaries/caQtDM.app/Contents/Frameworks
}
}
OBJECTS_DIR = ../obj1
DEFINES += SUPPORT=\\\"EPICS\\\"
MOC_DIR = ../moc
VPATH += ../src
INCLUDEPATH += ../src
DESTDIR = ../
UI_DIR += ../src
INCLUDEPATH += $(QWTINCLUDE)
INCLUDEPATH += ../../caQtDM_QtControls/src
INCLUDEPATH += ../../caQtDM_Lib/src
RESOURCES += ../src/caQtDM.qrc
RC_FILE = ../src/caQtDM.rc
ios {
APP_XML_FILES.files = ../caQtDM_IOS_Config.xml
QMAKE_BUNDLE_DATA += APP_XML_FILES
}
caQtDM_Viewer/caQtDM2/ 0000755 0002101 0021616 00000000000 12315302333 013544 5 ustar mezger sls caQtDM_Viewer/caQtDM2/caQtDM2.pro 0000644 0002101 0021616 00000001034 12315302333 015457 0 ustar mezger sls include (../caQtDM.pri)
TARGET = caQtDM_Hipa
TEMPLATE = app
LIBS += -L$(QTBASE) -Wl,-rpath,$(QTDM_RPATH) -lcaQtDM_Lib_Hipa
OBJECTS_DIR = ../obj2
DEFINES += SUPPORT=\\\"EPICS_ACS\\\"
QMAKE_POST_LINK = cp ../caQtDM_Hipa $(QTBASE)
QMAKE_CXXFLAGS += "-g"
QMAKE_CFLAGS_RELEASE += "-g"
MOC_DIR = ../moc
VPATH += ../src
INCLUDEPATH += ../src
DESTDIR = ../
UI_DIR += ../src
INCLUDEPATH += $(QWTINCLUDE)
INCLUDEPATH += ../../caQtDM_QtControls/src
INCLUDEPATH += ../../caQtDM_Lib/src
RESOURCES += ../src/caQtDM.qrc
RC_FILE = ../src/caQtDM.rc
caQtDM_Viewer/parser/ 0000755 0002101 0021616 00000000000 12401341006 013641 5 ustar mezger sls caQtDM_Viewer/parser/QtProperties.c 0000644 0002101 0021616 00000034014 12315302333 016454 0 ustar mezger sls /*
* This file is part of the caQtDM Framework, developed at the Paul Scherrer Institut,
* Villigen, Switzerland
*
* The caQtDM Framework 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 3 of the License, or
* (at your option) any later version.
*
* The caQtDM Framework 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 the caQtDM Framework. If not, see .
*
* Copyright (c) 2010 - 2014
*
* Author:
* Anton Mezger
* Contact details:
* anton.mezger@psi.ch
*/
#if defined(_MSC_VER)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include
#include
#include
#include
#include "QtProperties.h"
#define DEFAULT_FORMAT "% 6.2f"
#define DEFAULT_FORMAT_WIDTH 6
#define DEFAULT_FORMAT_PRECISION 2
zOrder zorder[10000];
int zindex=0;
/*
static void uppercase(char *str)
{
int i;
for( i = 0; str[ i ]; i++)
str[i] = toupper( str[ i ] );
return;
}
*/
static void replace_char (char *s, char find, char replace) {
while (*s != 0) {
if (*s == find) *s = replace;
s++;
}
}
void niceChannel(char *value)
{
replace_char (value, ' ', '\0');
replace_char (value, ';', ':');
//uppercase(value);
}
/* Checks format validity and calls compute_format_size */
static void wheelSwitchFormat(char *format, int *width, int *precision)
{
char *percent = NULL,*fpart = NULL,*ad;
char format_used[255];
char flag_char[2] = " ";
int nparsed = 0;
*width = DEFAULT_FORMAT_WIDTH;
*precision = DEFAULT_FORMAT_PRECISION;
/* Check for a % with an f following somewhere after */
percent = strchr(format, '%');
if(percent != NULL) {
fpart = strchr(percent, 'f');
}
if(percent == NULL || fpart == NULL) {
/* Doesn't have % with an f following, use the default */
strcpy(format_used, DEFAULT_FORMAT);
} else {
/* Copy prefix and % (i.e. everything through %) */
format_used[0] = '\0';
strncat(format_used, format, percent - format + 1);
/* Check flag(s). We want '+' or ' ', with '+' superceding ' ' */
ad = percent + 1;
while(1) {
if(*ad == '+') {
/* Use + as the flag */
flag_char[0]='+';
ad++;
} else if(*ad == ' ' || *ad == '#' || *ad == '0' || *ad == '-') {
/* A flag, but use what we have now (+ or space) */
ad++;
} else {
/* Not a flag */
break;
}
}
/* Add the single flag we want to use */
strcat(format_used, flag_char);
/* Width, point, and precision: Must be of form n.m. Ignore
* anything between this and f. Copy f to end. */
nparsed=sscanf(ad,"%d.%d", width, precision);
if(nparsed == 2) {
if(*width < 0) *width=DEFAULT_FORMAT_WIDTH;
if(*precision < 0) *precision=DEFAULT_FORMAT_PRECISION;
if(*precision > *width-1) *precision=*width-1;
if(*precision < 0) *precision=0;
} else if(nparsed == 1) {
if(*width < 0) {
*width=DEFAULT_FORMAT_WIDTH;
*precision=DEFAULT_FORMAT_PRECISION;
} else {
*precision=0;
}
} else {
*width=DEFAULT_FORMAT_WIDTH;
*precision=DEFAULT_FORMAT_PRECISION;
}
}
}
void Qt_handleString(char *prop, char *tag, char *value)
{
C_writeOpenProperty(myParserPtr, prop);
// in case of a channel, we have to replace blancs, dots and ; used by AC
if(!strcmp(prop, "channel")) {
niceChannel(value);
}
C_writeTaggedString(myParserPtr, tag, value);
C_writeCloseProperty(myParserPtr);
}
void Qt_taggedString(char *tag, char *value)
{
C_writeTaggedString(myParserPtr, tag, value);
}
void Qt_writeOpenTag(char *tag, char *typ, char *value)
{
C_writeOpenTag(myParserPtr, tag, typ, value);
}
void Qt_writeCloseTag(char *tag, char *value, int visibilityStatic)
{
if(!strcmp(tag, "widget") && strstr(value, "ca")) {
strcpy(zorder[zindex].z, value);
zorder[zindex].vis = visibilityStatic;
zorder[zindex].indx = zindex;
zindex++;
}
C_writeCloseTag(myParserPtr, tag);
}
void Qt_writeOpenProperty(char *property)
{
C_writeOpenProperty(myParserPtr, property);
}
void Qt_writeCloseProperty()
{
C_writeCloseProperty(myParserPtr);
}
void Qt_writeStyleSheet(int r, int g, int b)
{
C_writeStyleSheet(myParserPtr, r, g, b);
}
void Qt_setWheelSwitchForm(char *widget, char *token)
{
int width, precision;
char asc[10];
UNUSED(widget);
wheelSwitchFormat(token, &width, &precision);
if(precision != 0) {
sprintf(asc, "%d", width-precision-2);
} else {
sprintf(asc, "%d", width-precision-1);
}
Qt_handleString("integerDigits", "number", asc);
sprintf(asc, "%d", precision);
Qt_handleString("decimalDigits", "number", asc);
}
void Qt_setMinimumLimit(char *widget, int pen, char *token) {
if(strstr(widget, "caStripPlot") == (char*) 0) {
Qt_handleString("minValue", "double", token);
} else {
char asc[30];
sprintf(asc, "YaxisLimitsMin_%d", pen+1);
Qt_handleString(asc, "double", token);
}
}
void Qt_setMaximumLimit(char *widget, int pen, char *token) {
if(strstr(widget, "caStripPlot") == (char*) 0) {
Qt_handleString("maxValue", "double", token);
} else {
char asc[30];
sprintf(asc, "YaxisLimitsMax_%d", pen+1);
Qt_handleString(asc, "double", token);
}
}
void Qt_setPrecision(char *widget, int pen, char *token) {
UNUSED(pen);
if(!strcmp(widget, "caStripPlot")) return;
if(!strcmp(widget, "caThermo")) return;
if(!strcmp(widget, "caSlider")) return;
if(strstr(widget, "caNumeric") != (char*) 0) {
int prec;
char asc[10];
sscanf(token, "%d", &prec);
Qt_handleString("decimalDigits", "number", token);
sprintf(asc, "%d", prec+1);
Qt_handleString("integerDigits", "number", asc);
} else {
int prec;
char asc[10];
sscanf(token, "%d", &prec);
sprintf(asc, "%d", prec);
Qt_handleString("precision", "number", asc);
}
}
void Qt_setXaxisLimitSource(char *widget, char *token)
{
char asc[80];
if(strstr(token, "auto") != (char*) 0) {
sprintf(asc, "%s::Auto", widget);
}else if(strstr(token, "default") != (char*) 0) {
sprintf(asc, "%s::User", widget);
}else if(strstr(token, "user") != (char*) 0) {
sprintf(asc, "%s::User", widget);
}else if(strstr(token, "channel") != (char*) 0) {
sprintf(asc, "%s::Channel", widget);
}
Qt_handleString("XaxisScaling", "enum", asc);
}
void Qt_setYaxisLimitSource(char *widget, char *token)
{
char asc[80];
if(strstr(token, "auto") != (char*) 0) {
sprintf(asc, "%s::Auto", widget);
}else if(strstr(token, "default") != (char*) 0) {
sprintf(asc, "%s::User", widget);
}else if(strstr(token, "user") != (char*) 0) {
sprintf(asc, "%s::User", widget);
}else if(strstr(token, "channel") != (char*) 0) {
sprintf(asc, "%s::Channel", widget);
}
Qt_handleString("YaxisScaling", "enum", asc);
}
void Qt_setMinimumLimitSource(char *widget, int pen, char *token)
{
char strng[30];
if(strstr(widget, "Gauge") != (char*) 0) return;
if(strstr(token, "default") != (char*) 0) {
sprintf(strng, "%s::User", widget);
} else if(strstr(token, "channel") != (char*) 0) {
sprintf(strng, "%s::Channel", widget);
}
if(!strcmp(widget, "caStripPlot") || !strcmp(widget, "caCartesianPlot")) {
char asc[30];
sprintf(asc, "YaxisScalingMin_%d", pen+1);
Qt_handleString(asc, "enum", strng);
} else {
Qt_handleString("limitsMode", "enum", strng);
}
}
void Qt_setMaximumLimitSource(char *widget, int pen, char *token)
{
char strng[30];
if(strstr(widget, "Gauge") != (char*) 0) return;
if(strstr(token, "default") != (char*) 0) {
sprintf(strng, "%s::User", widget);
} else if(strstr(token, "channel") != (char*) 0) {
sprintf(strng, "%s::Channel", widget);
}
if(!strcmp(widget, "caStripPlot") || !strcmp(widget, "caCartesianPlot")) {
char asc[30];
sprintf(asc, "YaxisScalingMax_%d", pen+1);
Qt_handleString(asc, "enum", strng);
} else {
Qt_handleString("limitsMode", "enum", strng);
}
}
void Qt_setPrecisionSource(char *widget, int pen, char *token)
{
char asc[80], aux[80];
UNUSED(pen);
if(!strcmp(widget, "caStripPlot")) return;
if(!strcmp(widget, "caThermo")) return;
if(!strcmp(widget, "caSlider")) return;
if(strstr(widget, "Gauge") != (char*) 0) return;
strcpy(aux, token);
if(aux[0] >= 'a' && aux[0] <='z') aux[0] = aux[0] - 32;
if(!strcmp(aux, "Default")) strcpy(aux, "User");
sprintf(asc, "%s::%s", widget, aux);
Qt_handleString("precisionMode", "enum", asc);
}
void Qt_setColorFill(char *widget) {
UNUSED(widget);
C_writeOpenProperty(myParserPtr, "fillstyle");
C_writeTaggedString(myParserPtr, "enum", "Filled");
C_writeCloseProperty(myParserPtr);
}
int Qt_setColorMode(char *widget, char *token)
{
// returns 0 if alarm is static, 1 otherwise
char asc[80];
char aux[80];
if(strstr(widget, "Gauge") != (char*) 0) return 0;
if(!strcmp(token,"static")) {
sprintf(asc, "%s::Static", widget);
Qt_handleString("colorMode", "enum", asc);
return 0;
} else if(!strcmp(token,"alarm")) {
strcpy(aux, "Alarm");
if(!strcmp(widget, "caTextEntry")) strcpy(aux, "Alarm_Static");
if(!strcmp(widget, "caLineEdit")) strcpy(aux, "Alarm_Static");
sprintf(asc, "%s::%s", widget, aux);
Qt_handleString("colorMode", "enum", asc);
return 1;
} else if(!strcmp(token,"discrete")) {
sprintf(asc, "%s::Static", widget);
Qt_handleString("colorMode", "enum", asc);
return 0;
}
return 0;
}
int Qt_setVisibilityMode(char *widget, char *token)
{
// returns 0 if visibility is static, 1 otherwise
char asc[80];
if(!strcmp(token,"static")) {
sprintf(asc, "%s::StaticV", widget);
Qt_handleString("visibility", "enum", asc);
return 0;
} else if(!strcmp(token,"if not zero")) {
sprintf(asc, "%s::IfNotZero", widget);
Qt_handleString("visibility", "enum", asc);
return 1;
} else if(!strcmp(token,"if zero")) {
sprintf(asc, "%s::IfZero", widget);
Qt_handleString("visibility", "enum", asc);
return 1;
} else if(!strcmp(token,"calc")) {
sprintf(asc, "%s::Calc", widget);
Qt_handleString("visibility", "enum", asc);
return 1;
}
return 0;
}
static void Qt_setColor(char *property, int r, int g, int b, int alpha)
{
char asc[80];
C_writeOpenProperty(myParserPtr, property);
sprintf(asc,"color alpha=\"%d\"", alpha);
C_writeOpenTag(myParserPtr, asc, "", "");
sprintf(asc,"%d", r);
C_writeTaggedString(myParserPtr, "red", asc);
sprintf(asc,"%d", g);
C_writeTaggedString(myParserPtr, "green", asc);
sprintf(asc,"%d", b);
C_writeTaggedString(myParserPtr, "blue", asc);
C_writeCloseTag(myParserPtr,"color");
C_writeCloseProperty(myParserPtr);
}
void Qt_setColorForeground(char *widget, int r, int g, int b, int alpha) {
UNUSED(widget);
Qt_setColor("foreground", r, g, b, alpha);
}
void Qt_setColorBackground(char *widget, int r, int g, int b, int alpha) {
UNUSED(widget);
Qt_setColor("background", r, g, b, alpha);
}
void Qt_setColorScale(char *widget, int r, int g, int b, int alpha) {
UNUSED(widget);
Qt_setColor("scaleColor", r, g, b, alpha);
}
void Qt_setColorLine(char *widget, int r, int g, int b, int alpha) {
UNUSED(widget);
Qt_setColor("lineColor", r, g, b, alpha);
}
void Qt_setColorTrace(char *widget, int r, int g, int b, int alpha, int trace)
{
char asc[80];
UNUSED(widget);
sprintf(asc,"color_%d", trace);
Qt_setColor(asc, r, g, b, alpha);
}
void Qt_setColormain(char *widget, int r, int g, int b, int alpha)
{
char asc[80];
UNUSED(widget);
C_writeOpenProperty(myParserPtr, "palette");
C_writeOpenTag(myParserPtr, "palette", "", "");
C_writeOpenTag(myParserPtr, "active", "", "");
C_writeOpenTag(myParserPtr, "colorrole role=\"Window\"", "","");
C_writeOpenTag(myParserPtr, "brush brushstyle=\"SolidPattern\"", "","");
sprintf(asc,"color alpha=\"%d\"", alpha);
C_writeOpenTag(myParserPtr, asc, "", "");
sprintf(asc,"%d", r);
C_writeTaggedString(myParserPtr, "red", asc);
sprintf(asc,"%d", g);
C_writeTaggedString(myParserPtr, "green", asc);
sprintf(asc,"%d", b);
C_writeTaggedString(myParserPtr, "blue", asc);
C_writeCloseTag(myParserPtr,"color");
C_writeCloseTag(myParserPtr,"brush");
C_writeCloseTag(myParserPtr,"colorrole");
C_writeCloseTag(myParserPtr,"active");
C_writeOpenTag(myParserPtr, "inactive", "", "");
C_writeOpenTag(myParserPtr, "colorrole role=\"Window\"", "","");
C_writeOpenTag(myParserPtr, "brush brushstyle=\"SolidPattern\"", "","");
sprintf(asc,"color alpha=\"%d\"", alpha);
C_writeOpenTag(myParserPtr, asc, "", "");
sprintf(asc,"%d", r);
C_writeTaggedString(myParserPtr, "red", asc);
sprintf(asc,"%d", g);
C_writeTaggedString(myParserPtr, "green", asc);
sprintf(asc,"%d", b);
C_writeTaggedString(myParserPtr, "blue", asc);
C_writeCloseTag(myParserPtr,"color");
C_writeCloseTag(myParserPtr,"brush");
C_writeCloseTag(myParserPtr,"colorrole");
C_writeCloseTag(myParserPtr,"inactive");
C_writeCloseTag(myParserPtr,"palette");
C_writeCloseProperty(myParserPtr);
}
caQtDM_Viewer/parser/QtProperties.h 0000644 0002101 0021616 00000006247 12315302333 016470 0 ustar mezger sls /*
* This file is part of the caQtDM Framework, developed at the Paul Scherrer Institut,
* Villigen, Switzerland
*
* The caQtDM Framework 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 3 of the License, or
* (at your option) any later version.
*
* The caQtDM Framework 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 the caQtDM Framework. If not, see .
*
* Copyright (c) 2010 - 2014
*
* Author:
* Anton Mezger
* Contact details:
* anton.mezger@psi.ch
*/
#ifndef QTPROPERTIES_H
#define QTPROPERTIES_H
typedef struct myParser myParser;
typedef char string40[40];
typedef struct _zOrder {
int indx;
int vis;
string40 z;
} zOrder;
#define True 1==1
#define False !True
#define UNUSED(x) (void)(x)
extern myParser* myParserPtr;
extern myParser* C_Parser(myParser* p, char *strng);
extern myParser* C_writeOpenTag(myParser* p, char *type, char *cls, char *name );
extern myParser* C_writeCloseTag(myParser* p, char *type);
extern myParser* C_writeProperty(myParser* p, char *name, char *type, char *value);
extern myParser* C_writeOpenProperty(myParser* p, char *name);
extern myParser* C_writeTaggedString(myParser* p, char *type, char *value );
extern myParser* C_writeCloseProperty(myParser* p);
extern myParser* C_writeStyleSheet(myParser* p, int r, int g, int b);
void Qt_handleString(char *property, char *tag, char *value);
void Qt_taggedString(char *tag, char *value);
void Qt_writeOpenTag(char *tag, char *typ, char *value);
void Qt_writeCloseTag(char *tag, char *value, int visibilityStatic);
void Qt_writeOpenProperty(char *property);
void Qt_writeCloseProperty();
void Qt_writeStyleSheet();
void Qt_setWheelSwitchForm(char *widget, char *token);
int Qt_setColorMode(char *widget, char *token);
int Qt_setVisibilityMode(char *widget, char *token);
void Qt_setColorBackground(char *widget, int r, int g, int b, int alpha);
void Qt_setColorForeground(char *widget, int r, int g, int b, int alpha);
void Qt_setColorLine(char *widget, int r, int g, int b, int alpha);
void Qt_setColorTrace(char *widget, int r, int g, int b, int alpha, int trace);
void Qt_setColorScale(char *widget, int r, int g, int b, int alpha);
void Qt_setColorFill(char *widget);
void Qt_setMinimumLimit(char *widget, int pen, char *token);
void Qt_setMaximumLimit(char *widget, int pen, char *token);
void Qt_setPrecision(char *widget, int pen, char *token);
void Qt_setXaxisLimitSource(char *widget, char *token);
void Qt_setYaxisLimitSource(char *widget, char *token);
void Qt_setMinimumLimitSource(char *widget, int pen, char *token);
void Qt_setMaximumLimitSource(char *widget, int pen, char *token);
void Qt_setPrecisionSource(char *widget, int pen, char *token);
void Qt_setColormain(char *widget, int r, int g, int b, int alpha);
void niceChannel(char *value);
#endif
caQtDM_Viewer/parser/XmlWriter.cpp 0000644 0002101 0021616 00000007415 12315302333 016315 0 ustar mezger sls /*
Copyright (C) 1992-2003 Trolltech AS. All Rights Reserved.
This file ("Example Code"), is part of an example program for Qt,
and is licensed under the Qt Commercial License Agreement,
Agreement version 2.4 and higher as well as under the GPL.
The Example Code is licensed to you "as is" without warranty of
any kind. To the maximum extent permitted by applicable law,
Trolltech on behalf of itself and its suppliers, disclaims all
warranties express or implied, including, but not limited to,
implied warranties of merchantability and fitness for a particular
purpose with regard to the Example Code. Trolltech does not
warrant that the Example Code will satisfy your requirements or
that it is without defect or error or that the operation thereof
will be uninterrupted. All use of and reliance on the Example Code
is at the sole risk of and responsibility of you and your
customers.
If you are a holder of a Qt Commercial License Agreement, you can
use the code under that agreement or you can use it under GPL. If
you are not a holder of a Qt Commercial License Agreement, you can
use the code under the GPL. Regardless of the applicable license
agreement, the Example Code may be used, distributed and modified
without limitation.
*/
#include
#include "XmlWriter.h"
#include
XmlWriter::XmlWriter( QIODevice *device, QTextCodec *codec )
: indentSize( 4 ), autoNewLine( false ), atBeginningOfLine( true )
{
out.setDevice( device );
out.setCodec("UTF-8");
out << "\n";
}
XmlWriter::~XmlWriter()
{
qDebug() << "xml destructor";
if ( autoNewLine && !atBeginningOfLine )
out << endl;
}
QString XmlWriter::protect( const QString& string )
{
QString s = string;
s.replace( "&", "&" );
s.replace( ">", ">" );
s.replace( "<", "<" );
//s.replace( "\"", """ );
s.replace( "\'", "'" );
return s;
}
QString XmlWriter::opening( const QString& tag, const AttrMap& attrs, const AttrMap& attrs1)
{
QString s = "<" + tag;
AttrMap::ConstIterator a = attrs.begin();
while ( a != attrs.end() ) {
s += " " + a.key() + "=\"" + protect( *a ) + "\"";
++a;
}
a = attrs1.begin();
while ( a != attrs1.end() ) {
s += " " + a.key() + "=\"" + protect( *a ) + "\"";
++a;
}
s += ">";
return s;
}
void XmlWriter::writePendingIndent()
{
if ( atBeginningOfLine ) {
out << indentStr;
atBeginningOfLine = false;
}
}
void XmlWriter::newLine()
{
out << endl;
atBeginningOfLine = true;
}
void XmlWriter::writeRaw( const QString& xml )
{
out << xml;
atBeginningOfLine = false;
}
void XmlWriter::writeString( const QString& string )
{
out << protect( string );
atBeginningOfLine = false;
}
void XmlWriter::writeOpenTag( const QString& name, const AttrMap& attrs, const AttrMap& attrs1 )
{
writePendingIndent();
out << opening( name, attrs, attrs1 );
indentStr += QString().fill( ' ', indentSize );
if ( autoNewLine )
newLine();
}
void XmlWriter::writeCloseTag( const QString& name )
{
indentStr = indentStr.mid( indentSize );
writePendingIndent();
out << opening( "/" + name );
if ( autoNewLine )
newLine();
}
void XmlWriter::writeAtomTag( const QString& name, const AttrMap& attrs )
{
writePendingIndent();
QString atom = opening( name, attrs );
atom.insert( atom.length() - 1, "/" );
out << atom;
if ( autoNewLine )
newLine();
}
void XmlWriter::writeTaggedString( const QString& name, const QString& string,
const AttrMap& attrs )
{
writePendingIndent();
out << opening( name, attrs );
writeString( string );
out << opening( "/" + name );
if ( autoNewLine )
newLine();
}
caQtDM_Viewer/parser/XmlWriter.h 0000644 0002101 0021616 00000005063 12315302333 015757 0 ustar mezger sls /*
Copyright (C) 1992-2003 Trolltech AS. All Rights Reserved.
This file ("Example Code"), is part of an example program for Qt,
and is licensed under the Qt Commercial License Agreement,
Agreement version 2.4 and higher as well as under the GPL.
The Example Code is licensed to you "as is" without warranty of
any kind. To the maximum extent permitted by applicable law,
Trolltech on behalf of itself and its suppliers, disclaims all
warranties express or implied, including, but not limited to,
implied warranties of merchantability and fitness for a particular
purpose with regard to the Example Code. Trolltech does not
warrant that the Example Code will satisfy your requirements or
that it is without defect or error or that the operation thereof
will be uninterrupted. All use of and reliance on the Example Code
is at the sole risk of and responsibility of you and your
customers.
If you are a holder of a Qt Commercial License Agreement, you can
use the code under that agreement or you can use it under GPL. If
you are not a holder of a Qt Commercial License Agreement, you can
use the code under the GPL. Regardless of the applicable license
agreement, the Example Code may be used, distributed and modified
without limitation.
*/
#ifndef XMLWRITER_H
#define XMLWRITER_H
#include
#include
#include
class AttrMap : public QMap
{
public:
AttrMap() { }
AttrMap( const QString& name, const QString& value ) {
insert( name, value );
}
};
class XmlWriter
{
public:
XmlWriter( QIODevice *device, QTextCodec *codec = 0 );
~XmlWriter();
void writeRaw( const QString& xml );
void writeString( const QString& string );
void writeOpenTag( const QString& name, const AttrMap& attrs = AttrMap(), const AttrMap& attr1 = AttrMap());
void writeCloseTag( const QString& name );
void writeAtomTag( const QString& name, const AttrMap& attrs = AttrMap() );
void writeTaggedString( const QString& name, const QString& string,
const AttrMap& attrs = AttrMap() );
void newLine();
void setIndentSize( int size ) { indentSize = size; }
void setAutoNewLine( bool on ) { autoNewLine = on; }
private:
QString protect( const QString& string );
QString opening( const QString& tag, const AttrMap& attrs = AttrMap(), const AttrMap& attrsn = AttrMap() );
void writePendingIndent();
QTextStream out;
QString indentStr;
int indentSize;
bool autoNewLine;
bool atBeginningOfLine;
};
#endif
caQtDM_Viewer/parser/dmsearchfile.cpp 0000644 0002101 0021616 00000004070 12315302333 017000 0 ustar mezger sls /*
* This file is part of the caQtDM Framework, developed at the Paul Scherrer Institut,
* Villigen, Switzerland
*
* The caQtDM Framework 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 3 of the License, or
* (at your option) any later version.
*
* The caQtDM Framework 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 the caQtDM Framework. If not, see .
*
* Copyright (c) 2010 - 2014
*
* Author:
* Anton Mezger
* Contact details:
* anton.mezger@psi.ch
*/
#include
#include "dmsearchfile.h"
#include
dmsearchFile::dmsearchFile(QString filename)
{
_FileName = filename;
}
QString dmsearchFile::findFile()
{
if(_FileName.isNull()) return NULL;
QString path = (QString) getenv("CAQTDM_DISPLAY_PATH");
#ifdef _MSC_VER
QStringList paths = path.split(";");
#else
QStringList paths = path.split(":");
#endif
// first search in current directory
QString FileName = _FileName;
bool fileFound = false;
QFileInfo fi(FileName);
// file was not found, go through path list
if(!fi.exists()) {
for(int i=0; i< paths.count(); i++) {
FileName = paths[i] + "/" + _FileName;
QFileInfo fi(FileName);
if(fi.exists()) {
fileFound = true;
break;
}
}
// file was found in current directory
} else {
fileFound = true;
}
// return filename or null
if(fileFound) {
//printf("dmsearchFile %s\n", FileName.toAscii().constData());
return FileName;
}
else return NULL;
}
QString dmsearchFile::displayPath()
{
return (QString) getenv("CAQTDM_DISPLAY_PATH");
}
caQtDM_Viewer/parser/dmsearchfile.h 0000644 0002101 0021616 00000002243 12315302333 016445 0 ustar mezger sls /*
* This file is part of the caQtDM Framework, developed at the Paul Scherrer Institut,
* Villigen, Switzerland
*
* The caQtDM Framework 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 3 of the License, or
* (at your option) any later version.
*
* The caQtDM Framework 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 the caQtDM Framework. If not, see .
*
* Copyright (c) 2010 - 2014
*
* Author:
* Anton Mezger
* Contact details:
* anton.mezger@psi.ch
*/
#ifndef DMSEARCHFILE_H
#define DMSEARCHFILE_H
#include
#include
class dmsearchFile
{
public:
dmsearchFile(QString FileName);
QString findFile();
QString displayPath();
private:
QString _FileName;
};
#endif // DMSEARCHFILE_H
caQtDM_Viewer/parser/myParser.cpp 0000644 0002101 0021616 00000026736 12315302333 016171 0 ustar mezger sls /*
* This file is part of the caQtDM Framework, developed at the Paul Scherrer Institut,
* Villigen, Switzerland
*
* The caQtDM Framework 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 3 of the License, or
* (at your option) any later version.
*
* The caQtDM Framework 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 the caQtDM Framework. If not, see .
*
* Copyright (c) 2010 - 2014
*
* Author:
* Anton Mezger
* Contact details:
* anton.mezger@psi.ch
*/
#include
#include "parser.h"
#include
#include
#include "XmlWriter.h"
#include
#include "dmsearchfile.h"
#include
#include
extern "C" TOKEN parseAndAppendDisplayList(DisplayInfo *displayInfo, FrameOffset *offset, char *firstToken, TOKEN firstTokenType);
extern "C" TOKEN getToken(DisplayInfo *displayInfo, char *word);
extern "C" void parseFile(DisplayInfo *displayInfo);
extern "C" void *parseDisplay(DisplayInfo *displayInfo);
extern "C" DlColormap *parseColormap(DisplayInfo *displayInfo, FILE *filePtr);
extern "C" void Qt_writeZorder();
extern "C" int parsingCompositeFile;
extern "C" int generateFlatFile;
extern "C" int generateDeviceOnMenus;
extern "C" int legendsForStripplot;
typedef char string40[40];
typedef struct _zOrder {
int indx;
int vis;
string40 z;
} zOrder;
extern "C" zOrder zorder[1000];
extern "C" int zindex;
extern "C" char filePrefix[128];
class myParser {
public:
myParser ();
void openFile(char *outFile);
void closeFile();
void writeProperty(const QString& name, const QString& type, const QString& value );
void writeOpenProperty(const QString& name);
void writeTaggedString(const QString& type, const QString& value );
void writeCloseProperty();
void writeStyleSheet(int r, int g, int b);
void writeOpenTag(const QString& type, const QString& cls = "", const QString& name = "");
void writeCloseTag(const QString& type);
XmlWriter *xw;
myParser *adlParser;
QFile *file;
QString StyleSheet;
void test();
void Init(myParser* adlParser);
void writeMessage(char *mess);
private:
};
// pointer used by external C
extern "C" {
myParser* myParserPtr;
}
// constructor
myParser::myParser () {
}
void myParser::openFile(char *outFile)
{
dmsearchFile *s = new dmsearchFile("stylesheet.qss");
QString fileNameFound = s->findFile();
if(fileNameFound.isNull()) {
printf("adl2ui -- file could not be loaded, is 'CAQTDM_DISPLAY_PATH' <%s> defined?\n", s->displayPath().toAscii().constData());
printf("adl2ui -- could be a problem!\n");
} else {
QFile file(fileNameFound);
file.open(QFile::ReadOnly);
StyleSheet = QLatin1String(file.readAll());
printf("adl2ui -- file found and will be integrated in the resulting ui file\n");
printf("adl2ui -- if you do not want any styles, redefine CAQTDM_DISPLAY_PATH\n");
file.close();
}
file = new QFile(outFile);
if (!file->open(QIODevice::WriteOnly | QIODevice::Text)) exit(0);
xw = new XmlWriter(file);
xw->setAutoNewLine(true);
xw->writeRaw( "" );
xw->newLine();
xw->writeTaggedString( "class", "MainWindow" );
xw->writeOpenTag("widget", AttrMap("class", "QMainWindow"), AttrMap("name", "MainWindow"));
}
void myParser::writeStyleSheet(int r, int g, int b)
{
xw->writeOpenTag( "property", AttrMap("name", "styleSheet") );
QString color = "\n\nQWidget#centralWidget {background: rgba(%1, %2, %3, 255);}\n\n";
color = color.arg(r).arg(g).arg(b);
QString styles = color;
styles.append(StyleSheet);
xw->writeTaggedString( "string", styles);
xw->writeCloseTag( "property");
}
static int compareFunc(const zOrder &a, const zOrder &b)
{
//printf("%d %d\n", a->vis, b->vis);
return (b.vis > a.vis);
}
void myParser::closeFile()
{
QVector myvector;
QVector::iterator it;
// create a vector with the order we had when parsing
for(int i=0; iindx << it->vis << it->z;
xw->writeTaggedString("zorder", it->z);
}
xw->writeCloseTag( "widget");
xw->writeCloseTag( "widget");
xw->writeRaw( "");
file->close();
}
void myParser::writeProperty(const QString& name, const QString& type, const QString& value )
{
xw->writeOpenTag( "property", AttrMap("name", name) );
xw->writeTaggedString( type, value );
xw->writeCloseTag( "property" );
}
void myParser::writeOpenProperty(const QString& name)
{
xw->writeOpenTag( "property", AttrMap("name", name) );
}
void myParser::writeTaggedString(const QString& type, const QString& value )
{
xw->writeTaggedString( type, value );
}
void myParser::writeCloseProperty()
{
xw->writeCloseTag( "property" );
}
void myParser::writeOpenTag(const QString& type, const QString& cls, const QString& name )
{
if(cls.size() != 0 && name.size() != 0) {
xw->writeOpenTag( type, AttrMap("class", cls), AttrMap("name", name));
} else {
xw->writeOpenTag( type) ;
}
}
void myParser::writeCloseTag(const QString& type)
{
xw->writeCloseTag(type);
}
void myParser::Init(myParser* adlParser)
{
myParserPtr = adlParser;
}
void myParser::writeMessage(char *mess) {
Q_UNUSED(mess);
//qDebug() << mess;
}
extern "C" myParser* C_writeOpenTag(myParser* p, char *type, char *cls, char *name )
{
p->writeOpenTag(type, cls, name);
return p;
}
extern "C" myParser* C_writeCloseTag(myParser* p, char *type)
{
p->writeCloseTag(type);
return p;
}
extern "C" myParser* C_writeProperty(myParser* p, char *name, char *type, char *value)
{
p->writeProperty(name, type, value);
return p;
}
extern "C" myParser* C_writeOpenProperty(myParser* p, char *name)
{
p->writeOpenProperty(name);
return p;
}
extern "C" myParser* C_writeTaggedString(myParser* p, char *type, char *value )
{
p->writeTaggedString(type, value);
return p;
}
extern "C" myParser* C_writeCloseProperty(myParser* p)
{
p->writeCloseProperty();
return p;
}
extern "C" myParser* C_adlParser(myParser* p, char* strng)
{
p->writeMessage(strng);
p->writeProperty( "name", "cstring", strng );
return p;
}
extern "C" myParser* C_writeStyleSheet(myParser* p, int r, int g, int b)
{
p->writeStyleSheet(r, g, b);
return p;
}
/*
*
*/
class myParser;
int main(int argc, char *argv[])
{
int in, numargs;
char inFile[80] = "";
generateFlatFile = false;
parsingCompositeFile = false;
generateDeviceOnMenus = false;
legendsForStripplot = true;
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
for (numargs = argc, in = 1; in < numargs; in++) {
if ( strcmp (argv[in], "-flat" ) == 0 ) {
in++;
generateFlatFile = true;
}
if ( strcmp (argv[in], "-deviceonmenu" ) == 0 ) {
in++;
generateDeviceOnMenus = true;
}
if ( strcmp (argv[in], "-nolegends" ) == 0 ) {
in++;
legendsForStripplot = false;
}
if ( strcmp (argv[in], "-v" ) == 0 ) {
printf("adl2ui version %s for %s\n", BUILDVERSION, BUILDARCH);
exit(0);
}
if(!strcmp(argv[in],"-help") || !strcmp(argv[in],"-h") || !strcmp(argv[in],"-?")) {
in++;
printf("Usage:\n adl2ui [options] file\n");
printf("[-flat] : flat file will be generated, includes are integrated\n");
printf("[-nolegends] : no legends will be generated for the stripplots\n");
printf("[-deviceonmenu : part of pv will be used for the label of menu\n");
exit(1);
}
if (strncmp (argv[in], "-" , 1) == 0) {
/* unknown application argument */
printf("adl2ui -- Argument %d = [%s] is unknown! ",in,argv[in]);
printf("possible are: '-flat and '-deviceonmenu' and '-nolegends' and '-v'\n");
exit(-1);
} else {
printf("adl2ui -- file = <%s>\n", argv[in]);
strcpy(inFile, argv[in]);
}
}
if(generateFlatFile) printf("adl2ui -- a flat file will be generated\n");
if(generateDeviceOnMenus)printf("adl2ui -- device name will be put on menus\n");
if(!legendsForStripplot)printf("adl2ui -- legends will not be set for stripplot\n");
// input and out files
QString inputFile = inFile;
if(inputFile.size() < 1) {
qDebug() << "adl2ui -- sorry: no input file";
exit(-1);
}
QString openFile1, openFile2;
QString outputFile;
int found = inputFile.lastIndexOf(".adl");
if (found != -1) {
openFile1 = inputFile.mid(0, found);
} else {
openFile1 = inputFile;
}
openFile2 = openFile1;
outputFile = openFile1.append(".ui");
inputFile = openFile2.append(".adl");
// when file exists open it
QFileInfo fi(inputFile);
if(!fi.exists()) {
qDebug() << "adl2ui -- sorry, file" << inFile << "does not exist";
exit(-1);
}
// get path for composite file parsing
//qDebug() << fi.absolutePath();
strcpy(filePrefix, fi.absolutePath().toAscii().data());
// init adlParser
myParser *adlParser = new myParser;
adlParser->Init(adlParser);
//get rid of path, we want to generate where we are
outputFile = outputFile.section('/',-1);
adlParser->openFile(outputFile.toAscii().data());
// open input file
FILE *filePtr = fopen(inputFile.toAscii().data(), "r");
FrameOffset offset;
DisplayInfo *cdi = (DisplayInfo *) malloc(sizeof (DisplayInfo));
offset.frameX = 0;
offset.frameY = 0;
cdi->filePtr = filePtr;
// start parsing
tokenType = getToken(cdi, token);
if (tokenType == T_WORD && !strcmp(token, "file")) {
parseFile(cdi);
} else {
qDebug() << "dmDisplayListParse: Invalid .adl file (First block is not file block) file: " << inputFile;
return 0;
}
// continue parsing
tokenType = getToken(cdi, token);
if (tokenType == T_WORD && !strcmp(token, "display")) {
parseDisplay(cdi);
} else {
qDebug() << "dmDisplayListParse: Invalid .adl file (Second block is not display block) " << inputFile;
return 0;
}
// Read the colormap if there. Will also create cdi->dlColormap.
tokenType = getToken(cdi, token);
if (tokenType == T_WORD && (!strcmp(token, "color map") || !strcmp(token, "<>"))) {
cdi->dlColormap = parseColormap(cdi, cdi->filePtr);
if (cdi->dlColormap) {
tokenType = getToken(cdi, token);
} else {
printf("Invalid .adl file (Cannot parse colormap file: %s\n", inFile);
return 0;
}
}
// Proceed with parsing
while (parseAndAppendDisplayList(cdi, &offset, token, tokenType) != T_EOF) {
tokenType = getToken(cdi, token);
}
// close output file
adlParser->closeFile();
return 0;
}
caQtDM_Viewer/parser/myParser.h 0000644 0002101 0021616 00000002007 12315302333 015617 0 ustar mezger sls /*
* This file is part of the caQtDM Framework, developed at the Paul Scherrer Institut,
* Villigen, Switzerland
*
* The caQtDM Framework 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 3 of the License, or
* (at your option) any later version.
*
* The caQtDM Framework 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 the caQtDM Framework. If not, see .
*
* Copyright (c) 2010 - 2014
*
* Author:
* Anton Mezger
* Contact details:
* anton.mezger@psi.ch
*/
#include
#include "XmlWriter.h"
using namespace std;
class myParser {
public:
XmlWriter *xw;
};
caQtDM_Viewer/parser/parser.c 0000644 0002101 0021616 00000423376 12315302333 015324 0 ustar mezger sls /*
* This file is part of the caQtDM Framework, developed at the Paul Scherrer Institut,
* Villigen, Switzerland
*
* The caQtDM Framework 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 3 of the License, or
* (at your option) any later version.
*
* The caQtDM Framework 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 the caQtDM Framework. If not, see .
*
* Copyright (c) 2010 - 2014
*
* Author:
* Anton Mezger
* Contact details:
* anton.mezger@psi.ch
*/
#if defined (_MSC_VER)
#define _CRT_SECURE_NO_WARNINGS
#endif
#include
#include
#include "parser.h"
#include "QtProperties.h"
int parsingCompositeFile;
int generateFlatFile;
int generateDeviceOnMenus;
int legendsForStripplot;
char filePrefix[128] = "";
static string40 formatTable[] = { "decimal", "exponential", "engr. notation", "compact", "truncated",
"hexadecimal", "octal", "string",
"sexagesimal", "sexagesimal-hms", "sexagesimal-dms"};
static int nbFormats = 11;
TOKEN parseAndAppendDisplayList(DisplayInfo *displayInfo, FrameOffset *offset, char *firstToken, TOKEN firstTokenType);
DlColormap defaultDlColormap = {
/* ncolors */
65,
/* r, g, b, inten */
{{ 255, 255, 255, 255, },
{ 236, 236, 236, 0, },
{ 218, 218, 218, 0, },
{ 200, 200, 200, 0, },
{ 187, 187, 187, 0, },
{ 174, 174, 174, 0, },
{ 158, 158, 158, 0, },
{ 145, 145, 145, 0, },
{ 133, 133, 133, 0, },
{ 120, 120, 120, 0, },
{ 105, 105, 105, 0, },
{ 90, 90, 90, 0, },
{ 70, 70, 70, 0, },
{ 45, 45, 45, 0, },
{ 0, 0, 0, 0, },
{ 0, 216, 0, 0, },
{ 30, 187, 0, 0, },
{ 51, 153, 0, 0, },
{ 45, 127, 0, 0, },
{ 33, 108, 0, 0, },
{ 253, 0, 0, 0, },
{ 222, 19, 9, 0, },
{ 190, 25, 11, 0, },
{ 160, 18, 7, 0, },
{ 130, 4, 0, 0, },
{ 88, 147, 255, 0, },
{ 89, 126, 225, 0, },
{ 75, 110, 199, 0, },
{ 58, 94, 171, 0, },
{ 39, 84, 141, 0, },
{ 251, 243, 74, 0, },
{ 249, 218, 60, 0, },
{ 238, 182, 43, 0, },
{ 225, 144, 21, 0, },
{ 205, 97, 0, 0, },
{ 255, 176, 255, 0, },
{ 214, 127, 226, 0, },
{ 174, 78, 188, 0, },
{ 139, 26, 150, 0, },
{ 97, 10, 117, 0, },
{ 164, 170, 255, 0, },
{ 135, 147, 226, 0, },
{ 106, 115, 193, 0, },
{ 77, 82, 164, 0, },
{ 52, 51, 134, 0, },
{ 199, 187, 109, 0, },
{ 183, 157, 92, 0, },
{ 164, 126, 60, 0, },
{ 125, 86, 39, 0, },
{ 88, 52, 15, 0, },
{ 153, 255, 255, 0, },
{ 115, 223, 255, 0, },
{ 78, 165, 249, 0, },
{ 42, 99, 228, 0, },
{ 10, 0, 184, 0, },
{ 235, 241, 181, 0, },
{ 212, 219, 157, 0, },
{ 187, 193, 135, 0, },
{ 166, 164, 98, 0, },
{ 139, 130, 57, 0, },
{ 115, 255, 107, 0, },
{ 82, 218, 59, 0, },
{ 60, 180, 32, 0, },
{ 40, 147, 21, 0, },
{ 26, 115, 9, 0, },
}};
void parseDlColor(DisplayInfo *displayInfo, FILE *filePtr, DlColormapEntry *dlColor);
void parseObject(DisplayInfo *displayInfo, DlObject *object);
void parseGrid(DisplayInfo *displayInfo, char *widget);
DlColormap *parseAndExtractExternalColormap(DisplayInfo *displayInfo, char *filename);
void parseAndSkip(DisplayInfo *displayInfo);
TOKEN getToken(DisplayInfo *displayInfo, char *word);
void *parseRectangle(DisplayInfo *, FrameOffset *);
void *parseOval(DisplayInfo *, FrameOffset *);
void *parseArc(DisplayInfo *, FrameOffset *);
void *parseText(DisplayInfo *, FrameOffset *);
void *parsePolyline(DisplayInfo *displayInfo, FrameOffset *);
void *parseRelatedDisplay(DisplayInfo *, FrameOffset *);
void *parseShellCommand(DisplayInfo *, FrameOffset *);
void *parseBar(DisplayInfo *, FrameOffset *);
void *parseIndicator(DisplayInfo *, FrameOffset *);
void *parseChoiceButton(DisplayInfo *, FrameOffset *);
void *parseMessageButton(DisplayInfo *, FrameOffset *);
void *parseValuator(DisplayInfo *, FrameOffset *);
void *parseWheelSwitch(DisplayInfo *, FrameOffset *);
void *parseTextEntry(DisplayInfo *, FrameOffset *);
void *parseMenu(DisplayInfo *, FrameOffset *);
void parseControl(DisplayInfo *, char *widget);
void *parseImage(DisplayInfo *, FrameOffset *);
void *parseComposite(DisplayInfo *, FrameOffset *);
void *parsePolyline(DisplayInfo *, FrameOffset *);
void *parsePolygon(DisplayInfo *, FrameOffset *);
void *parseMeter(DisplayInfo *, FrameOffset *);
void *parseBar(DisplayInfo *, FrameOffset *);
void *parseByte(DisplayInfo *, FrameOffset *);
void *parseIndicator(DisplayInfo *, FrameOffset *);
void *parseTextUpdate(DisplayInfo *, FrameOffset *);
void *parseStripChart(DisplayInfo *, FrameOffset *);
void *parseCartesianPlot(DisplayInfo *, FrameOffset *);
void *getNextElement(DisplayInfo *pDI, char *token, FrameOffset *offset);
typedef void *(*medmParseFunc)(DisplayInfo *, FrameOffset *);
typedef struct {
char *name;
medmParseFunc func;
} ParseFuncEntry;
ParseFuncEntry parseFuncTable[] = {
{"rectangle", parseRectangle},
{"oval", parseOval},
{"arc", parseArc},
{"text", parseText},
{"falling line", parsePolyline},
{"rising line", parsePolyline},
{"related display", parseRelatedDisplay},
{"shell command", parseShellCommand},
{"bar", parseBar},
{"indicator", parseIndicator},
{"meter", parseMeter},
{"byte", parseByte},
{"strip chart", parseStripChart},
{"cartesian plot", parseCartesianPlot},
{"text update", parseTextUpdate},
{"choice button", parseChoiceButton},
{"button", parseChoiceButton},
{"message button", parseMessageButton},
{"menu", parseMenu},
{"text entry", parseTextEntry},
{"valuator", parseValuator},
{"image", parseImage},
{"composite", parseComposite},
{"polyline", parsePolyline},
{"polygon", parsePolygon},
{"wheel switch", parseWheelSwitch},
};
static int parseFuncTableSize = sizeof(parseFuncTable)/sizeof(ParseFuncEntry);
void correctOffset( DlObject *object, FrameOffset *offset, int *x, int *y, int *w, int *h)
{
*w = object->width;
*h = object->height;
if(offset->frameX == 0) {
*x = object->x;
} else {
*x = object->x - offset->frameX;
}
if(offset->frameY == 0) {
*y = object->y;
} else {
*y = object->y - offset->frameY;
}
}
void writeRectangleDimensions(DlObject *object, FrameOffset *offset, char *widget, int correct)
{
char asc[MAX_ASCII];
int x = offset->frameX;
int y = offset->frameY;
int w = offset->frameWidth;
int h = offset->frameHeight;
Qt_writeOpenProperty("geometry");
Qt_writeOpenTag("rect", "", "");
if(correct) correctOffset(object, offset, &x, &y, &w, &h);
sprintf(asc, "%d", x);
Qt_taggedString("x", asc);
sprintf(asc, "%d", y);
Qt_taggedString("y", asc);
// add two pixels for frames
if(!strcmp(widget,"caFrame")) {
sprintf(asc, "%d", w + 2);
Qt_taggedString("width", asc);
} else {
sprintf(asc, "%d", w);
Qt_taggedString("width", asc);
}
if(!strcmp(widget,"caFrame")) {
sprintf(asc, "%d", h + 2);
Qt_taggedString("height", asc);
} else {
sprintf(asc, "%d", h);
Qt_taggedString("height", asc);
}
Qt_writeCloseTag("rect", "", False);
Qt_writeCloseProperty();
}
// decompose string
int parseDelimited(char *s, string40 items[], int nbItems, char token)
{
int i, cnt;
char * pch;
char ctoken[2];
memcpy(ctoken, &token, 1);
ctoken[1] ='\0';
for (i=0; i< (int) strlen(s); i++) if(s[i] < ' ') s[i] = '\0';
cnt = 0;
pch = strtok (s, ctoken);
while (pch != NULL)
{
strcpy(items[cnt], pch);
pch = strtok (NULL, ctoken);
if(cnt++ >= nbItems) break;
}
return cnt;
}
void parseAndSkip(DisplayInfo *displayInfo)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
/* Just read and look for braces until we return to the same level */
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE || nestingLevel > 0) &&
(nestingLevel > 0) && (tokenType != T_EOF) );
}
/*** Name value table routines ***/
/*
* generate a name-value table from the passed-in argument string
* returns a pointer to a NameValueTable as the function value,
* and the number of values in the second parameter
* Syntax: argsString: "a=b,c=d,..."
*/
NameValueTable *generateNameValueTable(char *argsString, int *numNameValues)
{
char *copyOfArgsString, *name, *value;
char *s1;
char nameEntry[80], valueEntry[80];
int i, j, tableIndex, numPairs, numEntries;
NameValueTable *nameTable;
Boolean first;
tableIndex = 0;
nameTable = NULL;
copyOfArgsString = NULL;
if(argsString != NULL) {
copyOfArgsString = STRDUP(argsString);
/* see how many a=b name/value pairs are in the string */
numPairs = 0;
i = 0;
while(copyOfArgsString[i++] != '\0')
if(copyOfArgsString[i] == '=') numPairs++;
tableIndex = 0;
first = True;
for(numEntries = 0; numEntries < numPairs; numEntries++) {
/* at least one pair, proceed */
if(first) {
first = False;
nameTable = (NameValueTable *) calloc(1,
numPairs*sizeof(NameValueTable));
/* name = value, name = value, ... therefore */
/* name delimited by "=" and value delimited by "," */
s1 = copyOfArgsString;
} else {
s1 = NULL;
}
name = strtok(s1,"=");
value = strtok(NULL,",");
if(name != NULL && value != NULL) {
/* found legitimate name/value pair, put in table */
j = 0;
for(i = 0; i < (int) strlen(name); i++) {
if(!isspace(name[i]))
nameEntry[j++] = name[i];
}
nameEntry[j] = '\0';
j = 0;
/* Modified by A.Mezger : add possibility to have a space when entering the special character ¦ */
for(i = 0; i < (int) strlen(value); i++) {
if(!isspace(value[i])) {
if(value[i] != -90) {
valueEntry[j++] = value[i];
} else {
valueEntry[j++] = ' ';
}
}
}
valueEntry[j] = '\0';
nameTable[tableIndex].name = STRDUP(nameEntry);
nameTable[tableIndex].value = STRDUP(valueEntry);
tableIndex++;
}
}
if(copyOfArgsString) free(copyOfArgsString);
} else {
/* no pairs */
}
*numNameValues = tableIndex;
return (nameTable);
}
/*
* lookup name in name-value table, return associated value (or NULL if no
* match)
*/
char *lookupNameValue(NameValueTable *nameValueTable, int numEntries, char *name)
{
int i;
if(nameValueTable != NULL && numEntries > 0) {
for(i = 0; i < numEntries; i++)
if(!strcmp(nameValueTable[i].name,name))
return (nameValueTable[i].value);
}
return (NULL);
}
/*
* free the name value table
* first, all the strings pointed to by its entries
* then the table itself
*/
void freeNameValueTable(NameValueTable *nameValueTable, int numEntries)
{
int i;
if(nameValueTable != NULL) {
for(i = 0; i < numEntries; i++) {
if(nameValueTable[i].name != NULL) free ((char *)nameValueTable[i].name);
if(nameValueTable[i].value != NULL) free ((char *)
nameValueTable[i].value);
}
free ((char *)nameValueTable);
}
}
void objectAttributeInit(DlObject *object)
{
object->x = 0;
object->y = 0;
object->width = 10;
object->height = 10;
}
void parseDynAttrMod(DisplayInfo *displayInfo, char *widget)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"clr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!strcmp(token,"discrete")){
Qt_handleString("ColorMode", "value", "Discrete");
} else if(!strcmp(token,"static")) {
Qt_handleString("ColorMode", "value", "Static");
} else if(!strcmp(token,"alarm")) {
Qt_handleString("ColorMode", "value", "ALarm_Default");
}
} else if(!strcmp(token,"vis")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_setVisibilityMode(widget, token);
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
}
void parseDynAttrParam(DisplayInfo *displayInfo, char *widget)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
int i;
char chanName[6];
UNUSED(widget);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
for(i=0; i < MAX_CALC_RECORDS; i++) {
/* Names are chan, chanB, chanC, etc. */
sprintf(chanName,"chan%c",i?'A'+i:'\0');
if(!strcmp(token,chanName)) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(token[0]) {
Qt_handleString(chanName, "string", token);
break;
}
}
if(!strcmp(token,"calc")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(token[0]) {
Qt_handleString(chanName, "calc", token);
break;
}
}
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
}
void parseAttr(DisplayInfo *displayInfo, char *widget)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
int clr = 0;
UNUSED(widget);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"clr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
clr = atoi(token) % DL_MAX_COLORS;
Qt_setColorForeground("",displayInfo->dlColormap->dl_color[clr].r,
displayInfo->dlColormap->dl_color[clr].g,
displayInfo->dlColormap->dl_color[clr].b,
255);
} else if(!strcmp(token,"style")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!strcmp(token,"solid")) {
Qt_handleString("linestyle", "string", "Solid");
} else if(!strcmp(token,"dash")) {
Qt_handleString("linestyle", "string", "Dash");
}
} else if(!strcmp(token,"fill")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!strcmp(token,"solid")) {
Qt_handleString("fillstyle", "string", "Filled");
} else if(!strcmp(token,"outline")) {
Qt_handleString("fillstyle", "string", "Outline");
}
} else if(!strcmp(token,"width")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_handleString("width", "string", token);
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) ) ; /* Do nothing */
}
void parseDynamicAttr(DisplayInfo *displayInfo, char *widget)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"mod")) {
parseDynAttrMod(displayInfo, widget);
} else if(!strcmp(token,"param")) {
parseDynAttrParam(displayInfo, widget);
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
}
void parseMonitor(DisplayInfo *displayInfo, char *widget)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
int clr = 0;
int bclr = 0;
UNUSED(widget);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if (!strcmp(token,"rdbk") ||
!strcmp(token,"chan")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_handleString("channel", "string", token);
} else if (!strcmp(token,"clr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
clr = atoi(token) % DL_MAX_COLORS;
if(strstr(widget, "Gauge") != (char*) 0) {
} else {
Qt_setColorForeground("", displayInfo->dlColormap->dl_color[clr].r,
displayInfo->dlColormap->dl_color[clr].g,
displayInfo->dlColormap->dl_color[clr].b,
255);
}
} else if (!strcmp(token,"bclr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
bclr = atoi(token) % DL_MAX_COLORS;
if(strstr(widget, "Gauge") != (char*) 0) {
} else {
Qt_setColorBackground("", displayInfo->dlColormap->dl_color[bclr].r,
displayInfo->dlColormap->dl_color[bclr].g,
displayInfo->dlColormap->dl_color[bclr].b,
255);
}
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while ( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
}
void parseBasicAttribute(DisplayInfo *displayInfo, char *widget)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
int clr=0;
char fillstyle[MAX_TOKEN_LENGTH];
char linestyle[MAX_TOKEN_LENGTH];
strcpy(fillstyle, "solid");
strcpy(linestyle, "solid");
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"clr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
clr= atoi(token) % DL_MAX_COLORS;
} else if(!strcmp(token,"style")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(linestyle, token);
} else if(!strcmp(token,"fill")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(fillstyle, token);
} else if(!strcmp(token,"width")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_handleString("lineSize", "number", token);
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
if(!strcmp(widget,"caLabel")) {
Qt_setColorForeground("", displayInfo->dlColormap->dl_color[clr].r,
displayInfo->dlColormap->dl_color[clr].g,
displayInfo->dlColormap->dl_color[clr].b,
255);
Qt_setColorBackground("", displayInfo->dlColormap->dl_color[clr].r,
displayInfo->dlColormap->dl_color[clr].g,
displayInfo->dlColormap->dl_color[clr].b,
0);
} else if( (!strcmp(widget,"caPolyLine")) || (!strcmp(widget,"caGraphics")) || (!strcmp(widget,"caPolygon")) ) {
if(!strcmp(fillstyle,"solid")) {
Qt_setColorForeground("", displayInfo->dlColormap->dl_color[clr].r,
displayInfo->dlColormap->dl_color[clr].g,
displayInfo->dlColormap->dl_color[clr].b,
255);
Qt_setColorFill(widget);
Qt_setColorLine("", displayInfo->dlColormap->dl_color[clr].r,
displayInfo->dlColormap->dl_color[clr].g,
displayInfo->dlColormap->dl_color[clr].b,
255);
} else if(!strcmp(fillstyle,"outline")) {
Qt_setColorForeground("", displayInfo->dlColormap->dl_color[clr].r,
displayInfo->dlColormap->dl_color[clr].g,
displayInfo->dlColormap->dl_color[clr].b,
255);
Qt_setColorBackground("", displayInfo->dlColormap->dl_color[clr].r,
displayInfo->dlColormap->dl_color[clr].g,
displayInfo->dlColormap->dl_color[clr].b,
0);
Qt_setColorLine("", displayInfo->dlColormap->dl_color[clr].r,
displayInfo->dlColormap->dl_color[clr].g,
displayInfo->dlColormap->dl_color[clr].b,
255);
}
if(!strcmp(linestyle,"solid")) {
Qt_handleString("linestyle", "enum", "Solid");
} else if(!strcmp(linestyle,"dash")) {
Qt_handleString("linestyle", "enum", "Dash");
} else if(!strcmp(linestyle,"bigdash")) {
Qt_handleString("linestyle", "enum", "BigDash");
}
}
}
void parseLimits(DisplayInfo *displayInfo, char *widget, int pen, int DoNotWritePrec)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
int hoprSrc = False;
int loprSrc = False;
int precSrc = False;
int hoprDefault = False;
int loprDefault = False;
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"loprSrc")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
loprSrc = True;
Qt_setMinimumLimitSource(widget, pen, token);
} else if(!strcmp(token,"loprDefault")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_setMinimumLimit(widget, pen, token);
loprDefault= True;
} else if(!strcmp(token,"hoprSrc")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
hoprSrc = True;
Qt_setMaximumLimitSource(widget, pen, token);
} else if(!strcmp(token,"hoprDefault")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_setMaximumLimit(widget, pen, token);
hoprDefault= True;
} else if(!strcmp(token,"precSrc")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
precSrc = True;
if(!DoNotWritePrec)Qt_setPrecisionSource(widget, pen, token);
} else if(!strcmp(token,"precDefault")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!DoNotWritePrec) Qt_setPrecision(widget, pen, token);
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
if(!loprSrc) Qt_setMinimumLimitSource(widget, pen, "channel");
if(!hoprSrc) Qt_setMaximumLimitSource(widget, pen, "channel");
if(!DoNotWritePrec) {
if(!precSrc) Qt_setPrecisionSource(widget, pen, "channel");
}
if(!loprDefault && !hoprDefault) {
char asc[MAX_ASCII];
strcpy(asc, "0.0");
Qt_setMinimumLimit(widget, pen, asc);
strcpy(asc, "1.0");
Qt_setMaximumLimit(widget, pen, asc);
} else if(!loprDefault && hoprDefault) {
char asc[MAX_ASCII];
strcpy(asc, "0.0");
Qt_setMinimumLimit(widget, pen, asc);
}
if(!loprSrc && !hoprSrc && !strcmp(widget, "caCircularGauge")) {
Qt_handleString("displayLimits", "enum", "Channel_Limits");
Qt_handleString("alarmLimits", "enum", "Channel_Alarms");
} else if (!strcmp(widget, "caCircularGauge")) {
Qt_handleString("displayLimits", "enum", "User_Limits");
Qt_handleString("alarmLimits", "enum", "Channel_Alarms");
}
}
void parseDynamicAttribute(DisplayInfo *displayInfo, char *widget, int *visibilityStatic) {
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
*visibilityStatic = 0; // default is first layer
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"clr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
*visibilityStatic = Qt_setColorMode(widget, token);
} else if(!strcmp(token,"vis")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_setVisibilityMode(widget, token);
} else if(!strcmp(token,"calc")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if((strlen(token) > (size_t)0)) {
Qt_handleString("visibilityCalc", "string", token);
}
} else {
/* Channel names */
int i;
char chanName[10];
for(i=0; i < MAX_CALC_RECORDS; i++) {
/* Names are chan, chanB, chanC, etc. */
sprintf(chanName,"chan%c",i?'A'+i:'\0');
if(!strcmp(token,chanName)) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if((strlen(token) > (size_t)0)) {
sprintf(chanName,"channel%c",i?'A'+i:'\0');
Qt_handleString(chanName, "string", token);
}
}
}
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
}
void parseRelatedDisplayEntry(DisplayInfo *displayInfo, char *widget, char *label, char *file, char *arg, char *policy)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
UNUSED(widget);
do {
switch(tokenType=getToken(displayInfo,token)) {
case T_WORD:
if(!strcmp(token,"label")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(label, token);
} else if(!strcmp(token,"name")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(file, token);
} else if(!strcmp(token,"args")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(arg, token);
} else if(!strcmp(token,"policy")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(policy, token);
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while((tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF));
}
void parseGrid(DisplayInfo *displayInfo, char *widget)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
UNUSED(widget);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"gridSpacing")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
//grid->gridSpacing = atoi(token);
} else if(!strcmp(token,"gridOn")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
//grid->gridOn = atoi(token);
} else if(!strcmp(token,"snapToGrid")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
//grid->snapToGrid = atoi(token);
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
}
void parsePen(DisplayInfo *displayInfo, int pen, char *channels, char *widget)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
int clr = 0;
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if (!strcmp(token,"chan")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
// get rid of stupid signs and set to uppercase
niceChannel(token);
strcat(channels, token);
strcat(channels,";");
} else if (!strcmp(token,"clr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
clr = atoi(token) % DL_MAX_COLORS;
Qt_setColorTrace("", displayInfo->dlColormap->dl_color[clr].r,
displayInfo->dlColormap->dl_color[clr].g,
displayInfo->dlColormap->dl_color[clr].b,
255, pen+1);
} else if (!strcmp(token,"limits")) {
parseLimits(displayInfo, widget, pen, False);
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while ( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
}
void parseObject(DisplayInfo *displayInfo, DlObject *object)
{
// in case of labels, the width has not alwas been set properly by the user
// do nothing now, and set the object properties later
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
//Qt_writeOpenProperty("geometry");
//Qt_writeOpenTag("rect", "", "");
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"x")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
object->x = atoi(token);
} else if(!strcmp(token,"y")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
object->y = atoi(token);
} else if(!strcmp(token,"width")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
object->width = atoi(token);
if(object->width < 1) object->width=1; // oh; line without thickness
} else if(!strcmp(token,"height")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
object->height = atoi(token);
if(object->height < 1) object->height=1; // oh; line without thickness
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
}
void parsePlotcom(DisplayInfo *displayInfo, char *widget)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
int clr = 0;
int bclr = 0;
UNUSED(widget);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if (!strcmp(token,"title")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_handleString("Title", "string", token);
} else if (!strcmp(token,"xlabel")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_handleString("TitleX", "string", token);
/* this was desired by proscan and hipa, now taken out
if(strstr(token, "[") != (char*) 0 && strstr(widget, "caStripPlot") != (char*) 0) {
char asc[MAX_ASCII];
sprintf(asc, "%s::FillUnder", widget);
Qt_handleString("Style_1", "enum", asc);
}*/
} else if (!strcmp(token,"ylabel")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_handleString("TitleY", "string", token);
} else if (!strcmp(token,"package")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
printf("adl2ui -- package not supported\n");
} else if (!strcmp(token,"clr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
clr = atoi(token) % DL_MAX_COLORS;
Qt_setColorScale("", displayInfo->dlColormap->dl_color[clr].r,
displayInfo->dlColormap->dl_color[clr].g,
displayInfo->dlColormap->dl_color[clr].b,
255);
} else if (!strcmp(token,"bclr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
bclr = atoi(token) % DL_MAX_COLORS;
Qt_setColorForeground("", displayInfo->dlColormap->dl_color[bclr].r,
displayInfo->dlColormap->dl_color[bclr].g,
displayInfo->dlColormap->dl_color[bclr].b,
255);
Qt_setColorBackground("", displayInfo->dlColormap->dl_color[bclr].r,
displayInfo->dlColormap->dl_color[bclr].g,
displayInfo->dlColormap->dl_color[bclr].b,
255);
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while ( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
}
void parseTrace(DisplayInfo *displayInfo, int traceNr)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
char pvX[MAX_TOKEN_LENGTH];
char pvY[MAX_TOKEN_LENGTH];
char mon[2*MAX_TOKEN_LENGTH+1];
char channel[MAX_TOKEN_LENGTH];
int clr = 0;
pvX[0] = '\0';
pvY[0] = '\0';
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if (!strcmp(token,"xdata")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(pvX,token);
} else if (!strcmp(token,"ydata")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(pvY,token);
} else if (!strcmp(token,"data_clr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
clr = atoi(token) % DL_MAX_COLORS;
Qt_setColorTrace("", displayInfo->dlColormap->dl_color[clr].r,
displayInfo->dlColormap->dl_color[clr].g,
displayInfo->dlColormap->dl_color[clr].b,
255, traceNr+1);
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while ( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
sprintf(mon, "%s;%s", pvX, pvY);
sprintf(channel,"channels_%d", traceNr+1);
Qt_handleString(channel, "string", mon);
}
void parsePlotAxisDefinition(DisplayInfo *displayInfo, int axis)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
char minRange[MAX_TOKEN_LENGTH];
char maxRange[MAX_TOKEN_LENGTH];
int rangeStyleFound = False;
minRange[0] = '\0';
maxRange[0] = '\0';
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if (!strcmp(token,"axisStyle")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if (!strcmp(token,"linear")) {
printf("adl2ui -- only linear axis is supported by now\n");
} else if (!strcmp(token,"log10")) {
printf("adl2ui -- no logarithmic is supported by now\n");
} else if (!strcmp(token,"time")) {
printf("adl2ui -- no time axis is supported by now\n");
}
} else if (!strcmp(token,"rangeStyle")) {
rangeStyleFound = True;
getToken(displayInfo,token);
getToken(displayInfo,token);
if(axis == X_AXIS_ELEMENT) {
Qt_setXaxisLimitSource("caCartesianPlot", token);
} else if(axis == Y1_AXIS_ELEMENT){
Qt_setYaxisLimitSource("caCartesianPlot", token);
}
} else if (!strcmp(token,"minRange")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(minRange, token);
} else if (!strcmp(token,"maxRange")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(maxRange, token);
} else if (!strcmp(token,"timeFormat")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
printf("adl2ui -- no time format is supported by now\n");
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while ( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
if(minRange[0] != '\0' || maxRange[0] != '\0') {
char range[MAX_TOKEN_LENGTH];
if(minRange[0] == '\0') strcpy(minRange, "0");
if(maxRange[0] == '\0') strcpy(maxRange, "0");
if(axis == X_AXIS_ELEMENT) {
sprintf(range, "%s;%s", minRange, maxRange);
Qt_handleString("XaxisLimits", "string", range);
} else if(axis == Y1_AXIS_ELEMENT){
sprintf(range, "%s;%s", minRange, maxRange);
Qt_handleString("YaxisLimits", "string", range);
}
} else {
if(axis == X_AXIS_ELEMENT)Qt_handleString("XaxisLimits", "string", "0;1");
else if(axis == Y1_AXIS_ELEMENT) Qt_handleString("YaxisLimits", "string", "0;1");
}
if(!rangeStyleFound) {
if(axis == X_AXIS_ELEMENT) {
Qt_setXaxisLimitSource("caCartesianPlot", "channel");
} else if(axis == Y1_AXIS_ELEMENT) {
Qt_setYaxisLimitSource("caCartesianPlot", "channel");
}
}
}
void *parseCartesianPlot(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int traceNumber;
int styleFound = False;
int XrangeFound = False;
int Y1rangeFound = False;
int countDone = False;
int visibilityStatic = 2; // top layer
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caCartesianPlot_%d", number++);
Qt_writeOpenTag("widget", "caCartesianPlot", widgetName);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caCartesianPlot", True);
} else if(!strcmp(token,"plotcom")) {
parsePlotcom(displayInfo, "caCartesianPlot");
} else if(!strcmp(token,"count")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if((strlen(token) > 0) && (!countDone)){
countDone = True;
Qt_handleString("countNumOrChannel", "string", token);
}
} else if(!strcmp(token,"style")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
styleFound = True;
if(!strcmp(token,"point plot")) {
Qt_handleString("Style_1", "enum", "caCartesianPlot::Dots");
Qt_handleString("Style_2", "enum", "caCartesianPlot::Dots");
Qt_handleString("Style_3", "enum", "caCartesianPlot::Dots");
Qt_handleString("symbol_1", "enum", "caCartesianPlot::NoSymbol");
Qt_handleString("symbol_2", "enum", "caCartesianPlot::Rect");
Qt_handleString("symbol_3", "enum", "caCartesianPlot::Triangle");
} else if(!strcmp(token,"point")) {
Qt_handleString("Style_1", "enum", "caCartesianPlot::Dots");
Qt_handleString("Style_2", "enum", "caCartesianPlot::Dots");
Qt_handleString("Style_3", "enum", "caCartesianPlot::Dots");
Qt_handleString("symbol_1", "enum", "caCartesianPlot::NoSymbol");
Qt_handleString("symbol_2", "enum", "caCartesianPlot::Rect");
Qt_handleString("symbol_3", "enum", "caCartesianPlot::Triangle");
} else if(!strcmp(token,"line plot")) {
Qt_handleString("Style_1", "enum", "caCartesianPlot::Lines");
Qt_handleString("Style_2", "enum", "caCartesianPlot::Lines");
Qt_handleString("Style_3", "enum", "caCartesianPlot::Lines");
Qt_handleString("symbol_1", "enum", "caCartesianPlot::NoSymbol");
Qt_handleString("symbol_2", "enum", "caCartesianPlot::Rect");
Qt_handleString("symbol_3", "enum", "caCartesianPlot::Triangle");
} else if(!strcmp(token,"line")) {
Qt_handleString("Style_1", "enum", "caCartesianPlot::Lines");
Qt_handleString("Style_2", "enum", "caCartesianPlot::Lines");
Qt_handleString("Style_3", "enum", "caCartesianPlot::Lines");
Qt_handleString("symbol_1", "enum", "caCartesianPlot::NoSymbol");
Qt_handleString("symbol_2", "enum", "caCartesianPlot::Rect");
Qt_handleString("symbol_3", "enum", "caCartesianPlot::Triangle");
/* Modified by A.Mezger 6-8-10: added option lines without marks and thick lines */
} else if(!strcmp(token,"line-bigmarks")) {
Qt_handleString("Style_1", "enum", "caCartesianPlot::Lines");
Qt_handleString("Style_2", "enum", "caCartesianPlot::Lines");
Qt_handleString("Style_3", "enum", "caCartesianPlot::Lines");
Qt_handleString("symbol_1", "enum", "caCartesianPlot::Ellipse");
Qt_handleString("symbol_2", "enum", "caCartesianPlot::Rect");
Qt_handleString("symbol_3", "enum", "caCartesianPlot::Triangle");
} else if(!strcmp(token,"line-nomarks")) {
Qt_handleString("Style_1", "enum", "caCartesianPlot::Lines");
Qt_handleString("Style_2", "enum", "caCartesianPlot::Lines");
Qt_handleString("Style_3", "enum", "caCartesianPlot::Lines");
Qt_handleString("symbol_1", "enum", "caCartesianPlot::NoSymbol");
Qt_handleString("symbol_2", "enum", "caCartesianPlot::NoSymbol");
Qt_handleString("symbol_3", "enum", "caCartesianPlot::NoSymbol");
} else if(!strcmp(token,"line-thick")) {
Qt_handleString("Style_1", "enum", "caCartesianPlot::Lines");
Qt_handleString("Style_2", "enum", "caCartesianPlot::Lines");
Qt_handleString("Style_3", "enum", "caCartesianPlot::Lines");
Qt_handleString("symbol_1", "enum", "caCartesianPlot::NoSymbol");
Qt_handleString("symbol_2", "enum", "caCartesianPlot::Rect");
Qt_handleString("symbol_3", "enum", "caCartesianPlot::Triangle");
} else if(!strcmp(token,"fill under")) {
Qt_handleString("Style_1", "enum", "caCartesianPlot::FillUnder");
Qt_handleString("Style_2", "enum", "caCartesianPlot::FillUnder");
Qt_handleString("Style_3", "enum", "caCartesianPlot::FillUnder");
Qt_handleString("symbol_1", "enum", "caCartesianPlot::NoSymbol");
Qt_handleString("symbol_2", "enum", "caCartesianPlot::Rect");
Qt_handleString("symbol_3", "enum", "caCartesianPlot::Triangle");
} else if(!strcmp(token,"fill-under")) {
Qt_handleString("Style_1", "enum", "caCartesianPlot::FillUnder");
Qt_handleString("Style_2", "enum", "caCartesianPlot::FillUnder");
Qt_handleString("Style_3", "enum", "caCartesianPlot::FillUnder");
Qt_handleString("symbol_1", "enum", "caCartesianPlot::NoSymbol");
Qt_handleString("symbol_2", "enum", "caCartesianPlot::Rect");
Qt_handleString("symbol_3", "enum", "caCartesianPlot::Triangle");
}
} else if(!strcmp(token,"erase_oldest")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!strcmp(token,"on")) {
Qt_handleString("plotMode", "enum", "caCartesianPlot::PlotLastNPoints");
} else if(!strcmp(token,"off")) {
Qt_handleString("plotMode", "enum", "caCartesianPlot::PlotNPointsAndStop");
} else if(!strcmp(token,"plot last n pts")) {
Qt_handleString("plotMode", "enum", "caCartesianPlot::PlotLastNPoints");
} else if(!strcmp(token,"plot n pts & stop")) {
Qt_handleString("plotMode", "enum", "caCartesianPlot::PlotNPointsAndStop");
}
} else if(!strncmp(token,"trace",5)) {
traceNumber = MIN(token[6] - '0', MAX_TRACES - 1);
parseTrace(displayInfo,traceNumber);
} else if(!strcmp(token,"x_axis")) {
XrangeFound = True;
parsePlotAxisDefinition(displayInfo, X_AXIS_ELEMENT);
} else if(!strcmp(token,"y1_axis")) {
Y1rangeFound = True;
parsePlotAxisDefinition(displayInfo, Y1_AXIS_ELEMENT);
} else if(!strcmp(token,"y2_axis")) {
parsePlotAxisDefinition(displayInfo, Y2_AXIS_ELEMENT);
} else if(!strcmp(token,"trigger")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_handleString("triggerChannel", "string", token);
} else if(!strcmp(token,"erase")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_handleString("eraseChannel", "string", token);
} else if(!strcmp(token,"countPvName")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!countDone) {
countDone = True;
Qt_handleString("countNumOrChannel", "string", token);
}
} else if(!strcmp(token,"eraseMode")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!strcmp(token,"if not zero")) {
Qt_handleString("eraseMode", "enum", "caCartesianPlot::ifnotzero");
} else if(!strcmp(token,"if zero")) {
Qt_handleString("eraseMode", "enum", "caCartesianPlot::ifzero");
}
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
if(!styleFound) {
Qt_handleString("Style_1", "enum", "caCartesianPlot::Dots");
Qt_handleString("Style_2", "enum", "caCartesianPlot::Dots");
Qt_handleString("Style_3", "enum", "caCartesianPlot::Dots");
Qt_handleString("symbol_1", "enum", "caCartesianPlot::NoSymbol");
Qt_handleString("symbol_2", "enum", "caCartesianPlot::Rect");
Qt_handleString("symbol_3", "enum", "caCartesianPlot::Triangle");
}
if(!XrangeFound) Qt_setXaxisLimitSource("caCartesianPlot", "channel");
if(!Y1rangeFound) Qt_setYaxisLimitSource("caCartesianPlot", "channel");
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void *parseRelatedDisplay(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
char label[MAX_TOKEN_LENGTH] = "\0";
char name[MAX_TOKEN_LENGTH] = "\0";
char arg[MAX_TOKEN_LENGTH] = "\0";
char pol[MAX_TOKEN_LENGTH] = "\0";
int visibilityStatic = 2; // top layer
TOKEN tokenType;
int nestingLevel = 0;
int displayNumber;
int rc;
DlObject object;
char visual[MAX_TOKEN_LENGTH] = "Menu";
char labels[LONGSTRING] = "\0";
char names[LONGSTRING] = "\0";
char argus[LONGSTRING] = "\0";
char remos[LONGSTRING] = "\0";
static int number = 0;
int clr = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caRelatedDisplay_%d", number++);
Qt_writeOpenTag("widget", "caRelatedDisplay", widgetName);
do {
switch(tokenType=getToken(displayInfo,token)) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caRelatedDisplay", True);
} else if(!strncmp(token,"display",7)) {
/* Get the display number */
displayNumber=MAX_RELATED_DISPLAYS-1;
rc=sscanf(token,"display[%d]",&displayNumber);
if(rc == 0 || rc == EOF || displayNumber < 0 ||
displayNumber > MAX_RELATED_DISPLAYS-1) {
displayNumber=MAX_RELATED_DISPLAYS-1;
}
parseRelatedDisplayEntry(displayInfo, "caRelatedDisplay", label, name, arg, pol);
strcat(names, name); strcat(names, ";");
strcat(argus, arg); strcat(argus, ";");
strcat(labels, label); strcat(labels, ";");
if(!strncmp(pol,"replace", 7)) {
strcpy(pol, "true");
} else {
strcpy(pol, "false");
}
strcat(remos, pol); strcat(remos, ";");
} else if(!strcmp(token,"clr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
clr = atoi(token) % DL_MAX_COLORS;
Qt_setColorForeground("",displayInfo->dlColormap->dl_color[clr].r,
displayInfo->dlColormap->dl_color[clr].g,
displayInfo->dlColormap->dl_color[clr].b,
255);
} else if(!strcmp(token,"bclr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
clr = atoi(token) % DL_MAX_COLORS;
Qt_setColorBackground("",displayInfo->dlColormap->dl_color[clr].r,
displayInfo->dlColormap->dl_color[clr].g,
displayInfo->dlColormap->dl_color[clr].b,
255);
} else if(!strcmp(token,"label")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_handleString("label", "string", token);
} else if(!strcmp(token,"visual")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!strcmp(token,"a row of buttons")) {
strcpy(visual, "Row");
} else if(!strcmp(token,"a column of buttons")) {
strcpy(visual, "Column");
} else if(!strcmp(token, "invisible")) {
strcpy(visual, "Hidden");
}
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while((tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF));
Qt_handleString("stackingMode", "enum", visual);
if(strlen(labels) > 0) {
labels[strlen(labels) -1] = '\0';
Qt_handleString("labels", "string", labels);
}
if(strlen(names) > 0) {
names[strlen(names) -1] = '\0';
Qt_handleString("files", "string", names);
}
if(strlen(argus) > 0) {
argus[strlen(argus) -1] = '\0';
Qt_handleString("args", "string", argus);
}
if(strlen(remos) > 0) {
remos[strlen(remos) -1] = '\0';
Qt_handleString("removeParent", "string", remos);
}
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void parseShellCommandEntry(DisplayInfo *displayInfo, char *widget, char *label, char *file, char *arg)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
UNUSED(widget);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"label")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(label, token);
} else if(!strcmp(token,"name")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(file, token);
} else if(!strcmp(token,"args")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(arg, token);
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
}
void *parseShellCommand(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
char label[MAX_TOKEN_LENGTH] = "\0";
char name[MAX_TOKEN_LENGTH] = "\0";
char arg[MAX_TOKEN_LENGTH] = "\0";
TOKEN tokenType;
int nestingLevel = 0;
int cmdNumber;
int rc;
DlObject object;
int clr = 0;
int bclr = 0;
char labels[LONGSTRING] = "\0";
char names[LONGSTRING] = "\0";
char argus[LONGSTRING] = "\0";
int visibilityStatic = 2; // top layer
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caShellCommand_%d", number++);
Qt_writeOpenTag("widget", "caShellCommand", widgetName);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caParseShellCommand", True);
} else if(!strncmp(token,"command",7)) {
/* Get the command number */
cmdNumber=MAX_SHELL_COMMANDS-1;
rc=sscanf(token,"command[%d]",&cmdNumber);
if(rc == 0 || rc == EOF || cmdNumber < 0 ||
cmdNumber > MAX_SHELL_COMMANDS-1) {
cmdNumber=MAX_SHELL_COMMANDS-1;
}
parseShellCommandEntry(displayInfo, "caShellCommand", label, name, arg);
strcat(names, name); strcat(names, ";");
strcat(argus, arg); strcat(argus, ";");
strcat(labels, label); strcat(labels, ";");
} else if(!strcmp(token,"clr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
clr = atoi(token) % DL_MAX_COLORS;
Qt_setColorForeground("", displayInfo->dlColormap->dl_color[clr].r,
displayInfo->dlColormap->dl_color[clr].g,
displayInfo->dlColormap->dl_color[clr].b,
255);
} else if(!strcmp(token,"bclr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
bclr = atoi(token) % DL_MAX_COLORS;
Qt_setColorBackground("", displayInfo->dlColormap->dl_color[bclr].r,
displayInfo->dlColormap->dl_color[bclr].g,
displayInfo->dlColormap->dl_color[bclr].b,
255);
} else if(!strcmp(token,"label")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_handleString("label", "string", token);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
if(strlen(labels) > 0) {
labels[strlen(labels) -1] = '\0';
Qt_handleString("labels", "string", labels);
}
if(strlen(names) > 0) {
names[strlen(names) -1] = '\0';
Qt_handleString("files", "string", names);
}
if(strlen(argus) > 0) {
argus[strlen(argus) -1] = '\0';
Qt_handleString("args", "string", argus);
}
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void *parseMeter(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
char COLORMODE[MAX_TOKEN_LENGTH] = "static";
TOKEN tokenType;
int nestingLevel = 0;
static int number = 0;
DlObject object;
int visibilityStatic = 2; // top layer
char widgetName[MAX_ASCII];
sprintf(widgetName, "caCircularGauge_%d", number++);
Qt_writeOpenTag("widget", "caCircularGauge", widgetName);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caCircularGauge", True);
} else if(!strcmp(token,"monitor")) {
parseMonitor(displayInfo, "caCircularGauge");
} else if(!strcmp(token,"label")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
// labeltype none, no decorations, outline, limits, channel
// Qt_handleString("labelType", "enum", token);
} else if(!strcmp(token,"clrmod")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(COLORMODE, token);
} else if(!strcmp(token,"limits")) {
parseLimits(displayInfo, "caCircularGauge", 0, False);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
Qt_setColorMode("caCircularGauge", COLORMODE);
Qt_handleString("referenceEnabled", "bool", "false");
Qt_handleString("externalScale", "bool", "true");
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void *parseByte( DisplayInfo *displayInfo, FrameOffset * offset) {
char token[MAX_TOKEN_LENGTH];
char direction[MAX_TOKEN_LENGTH] = "Down";
char COLORMODE[MAX_TOKEN_LENGTH] = "static";
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int visibilityStatic = 2; // top layer
int sbitFound = False;
int ebitFound = False;
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caByte_%d", number++);
Qt_writeOpenTag("widget", "caByte", widgetName);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caByte", True);
} else if(!strcmp(token,"monitor")) {
parseMonitor(displayInfo, "caByte");
} else if(!strcmp(token,"clrmod")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(COLORMODE, token);
} else if(!strcmp(token,"direction")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!strcmp(token,"up")) {
strcpy(direction, "Up");
} else if(!strcmp(token,"right")) {
strcpy(direction, "Right");
} else if(!strcmp(token,"down")) {
strcpy(direction, "Down");
} else if(!strcmp(token,"left")) {
strcpy(direction, "Left");
}
} else if(!strcmp(token,"sbit")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
sbitFound = True;
Qt_handleString("startBit", "number", token);
} else if(!strcmp(token,"ebit")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
ebitFound = True;
Qt_handleString("endBit", "number", token);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
Qt_setColorMode("caByte", COLORMODE);
if(!sbitFound || !ebitFound) {
Qt_handleString("startBit", "enum", "0");
Qt_handleString("endBit", "enum", "15");
}
Qt_handleString("direction", "enum", direction);
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void *parseStripChart(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
char periodValue[MAX_TOKEN_LENGTH] = "";
char periodUnits[MAX_TOKEN_LENGTH] = "second";
char channels[LONGSTRING] = "";
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int penNumber;
int visibilityStatic = 2; // top layer
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caStripPlot_%d", number++);
Qt_writeOpenTag("widget", "caStripPlot", widgetName);
do {
switch( (tokenType=getToken(displayInfo, token)) ) {
case T_WORD:
if(!strcmp(token, "object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caStripPlot", True);
} else if(!strcmp(token, "plotcom")) {
parsePlotcom(displayInfo, "caStripPlot");
} else if(!strcmp(token, "period")) {
getToken(displayInfo, token);
getToken(displayInfo, token);
strcpy(periodValue, token);
} else if(!strcmp(token, "delay")) {
getToken(displayInfo, token);
getToken(displayInfo, token);
Qt_handleString("delay", "enum", token);
} else if(!strcmp(token, "units")) {
getToken(displayInfo, token);
getToken(displayInfo, token);
strcpy(periodUnits, token);
} else if(!strncmp(token, "pen", 3)) {
penNumber = MIN(token[4] - '0', MAX_PENS-1);
parsePen(displayInfo, penNumber, channels, "caStripPlot");
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
if(!strcmp(periodUnits, "minute")) {
Qt_handleString("units", "enum", "Minute");
} else if(!strcmp(periodUnits, "second")) {
Qt_handleString("units", "enum", "Second");
} else if(!strcmp(periodUnits, "milli second")) {
Qt_handleString("units", "enum", "Millisecond");
} else if(!strcmp(periodUnits, "milli-second")) {
Qt_handleString("units", "enum", "Millisecond");
} else {
Qt_handleString("units", "enum", "Second");
}
if(strlen(periodValue) < 1) {
Qt_handleString("period", "double", "60");
} else {
Qt_handleString("period", "double", periodValue);
}
channels[strlen(channels)-1] = '\0';
Qt_handleString("channels", "string", channels);
if(!legendsForStripplot) Qt_handleString("LegendEnabled", "bool", "false");
Qt_handleString("XaxisType", "enum", "ValueScale");
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void *parseTextUpdate(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
char COLORMODE[MAX_TOKEN_LENGTH] = "static";
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int alignFound=False;
int i= 0, format=0;
int visibilityStatic = 2; // top layer
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caLineEdit_%d", number++);
Qt_writeOpenTag("widget", "caLineEdit", widgetName);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caLineEdit", True);
Qt_handleString("fontScaleMode", "enum", "caLineEdit::WidthAndHeight");
} else if(!strcmp(token,"monitor")) {
parseMonitor(displayInfo, "caLineEdit");
} else if(!strcmp(token,"clrmod")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(COLORMODE, token);
} else if(!strcmp(token,"format")) {
int found=0;
getToken(displayInfo,token);
getToken(displayInfo,token);
for(i=0;i 0)
&& (tokenType != T_EOF) );
if(!alignFound) Qt_handleString("alignment", "set", "Qt::AlignAbsolute|Qt::AlignLeft|Qt::AlignVCenter");
Qt_handleString("formatType", "enum", formatTable[format]);
Qt_setColorMode("caLineEdit", COLORMODE);
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void *parseChoiceButton(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
char COLORMODE[MAX_TOKEN_LENGTH] = "static";
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int visibilityStatic = 2; // top layer
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caChoice_%d", number++);
Qt_writeOpenTag("widget", "caChoice", widgetName);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caChoice", True);
} else if(!strcmp(token,"control")) {
parseControl(displayInfo, "caChoice");
} else if(!strcmp(token,"clrmod")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(COLORMODE, token);
} else if(!strcmp(token,"stacking")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!strcmp(token,"row")) {
Qt_handleString("stackingMode", "enum", "Row");
} else if(!strcmp(token,"column")) {
Qt_handleString("stackingMode", "enum", "Column");
} else if(!strcmp(token,"row column")) {
Qt_handleString("stackingMode", "enum", "RowColumn");
}
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
Qt_setColorMode("caChoice", COLORMODE);
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void *parseMessageButton(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
char COLORMODE[MAX_TOKEN_LENGTH] = "static";
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int visibilityStatic = 2; // top layer
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caMessageButton_%d", number++);
Qt_writeOpenTag("widget", "caMessageButton", widgetName);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caMessageButton", True);
Qt_handleString("fontScaleMode", "enum", "EPushButton::WidthAndHeight");
} else if(!strcmp(token,"control")) {
parseControl(displayInfo, "caMessageButton");
} else if(!strcmp(token,"press_msg")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_handleString("pressMessage", "string", token);
} else if(!strcmp(token,"release_msg")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_handleString("releaseMessage", "string", token);
} else if(!strcmp(token,"label")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_handleString("label", "string", token);
} else if(!strcmp(token,"clrmod")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(COLORMODE, token);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
Qt_setColorMode("caMessageButton", COLORMODE);
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void *parseMenu(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
char COLORMODE[MAX_TOKEN_LENGTH] = "static";
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int visibilityStatic = 2; // top layer
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caMenu_%d", number++);
Qt_writeOpenTag("widget", "caMenu", widgetName);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caMenu", True);
} else if(!strcmp(token,"control")) {
parseControl(displayInfo, "caMenu");
} else if(!strcmp(token,"clrmod")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(COLORMODE, token);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
Qt_setColorMode("caMenu", COLORMODE);
// case for proscan
if(generateDeviceOnMenus) Qt_handleString("labelDisplay", "bool", "true");
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void *parseTextEntry(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
char COLORMODE[MAX_TOKEN_LENGTH] = "static";
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int i= 0, format=0;
int visibilityStatic = 2; // top layer
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caTextEntry_%d", number++);
Qt_writeOpenTag("widget", "caTextEntry", widgetName);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caLineEdit", True);
Qt_handleString("fontScaleMode", "enum", "caLineEdit::WidthAndHeight");
} else if(!strcmp(token,"control")) {
parseControl(displayInfo, "caTextEntry");
} else if(!strcmp(token,"clrmod")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(COLORMODE, token);
} else if(!strcmp(token,"format")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
for(i=0;i 0)
&& (tokenType != T_EOF) );
Qt_setColorMode("caLineEdit", COLORMODE);
Qt_handleString("formatType", "enum", formatTable[format]);
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void *parseValuator(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
char COLORMODE[MAX_TOKEN_LENGTH] = "static";
char direction[MAX_TOKEN_LENGTH] = "Right";
char look[MAX_TOKEN_LENGTH] = "noDeco";
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int visibilityStatic = 2; // top layer
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caSlider_%d", number++);
Qt_writeOpenTag("widget", "caSlider", widgetName);
do {
switch((tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caSlider", True);
} else if(!strcmp(token,"control")) {
parseControl(displayInfo, "caSlider");
} else if(!strcmp(token,"label")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!strcmp(token,"none")) {
strcpy(look, "noLabel");
} else if(!strcmp(token,"no decorations")) {
strcpy(look, "noDeco");
} else if(!strcmp(token,"outline")) {
strcpy(look, "Outline");
} else if(!strcmp(token,"limits")) {
strcpy(look, "Limits");
} else {
if(!strcmp(token,"channel")) {
strcpy(look, "channelV");
}
}
} else if(!strcmp(token,"clrmod")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(COLORMODE, token);
} else if(!strcmp(token,"direction")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!strcmp(token,"up")) {
strcpy(direction, "Up");
} else if(!strcmp(token,"right")) {
strcpy(direction, "Right");
} else if(!strcmp(token,"down")) {
strcpy(direction, "Down");
} else if(!strcmp(token,"left")) {
strcpy(direction, "Left");
}
} else if(!strcmp(token,"dPrecision")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_handleString("incrementValue", "double", token);
} else if(!strcmp(token,"limits")) {
parseLimits(displayInfo, "caSlider", 0, False);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while((tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
Qt_handleString("direction", "enum", direction);
if(!strcmp(look,"noLabel") || !strcmp(look,"noDeco")) {
Qt_handleString("scalePosition", "enum", "NoScale");
} else if(!strcmp(direction, "Up") || !strcmp(direction, "Down")) {
Qt_handleString("scalePosition", "enum", "LeftScale");
} else if(!strcmp(direction, "Right") || !strcmp(direction, "Left")) {
Qt_handleString("scalePosition", "enum", "BottomScale");
}
Qt_setColorMode("caSlider", COLORMODE);
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*)0;
}
void parseControl(DisplayInfo *displayInfo, char *widget)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
string40 items[10];
int nbitems;
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if (!strcmp(token,"ctrl") || !strcmp(token,"chan")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
//printf("==================== token = <%s>\n", token);
// specialty for proscan, we added bitstart and bitend to the channel sperated by a blanc
// and separated with a comma
nbitems = parseDelimited(token, items, 10, ' ');
if(nbitems > 0) {
Qt_handleString("channel", "string", items[0]);
//printf("==================== token = <%s> nbitems=%d\n", token, nbitems);
if(nbitems > 1) {
nbitems = parseDelimited(items[1], items, 10, ',');
//printf("==================== nbitems=%d <%s> <%s>\n", nbitems, items[0], items[1]);
Qt_handleString("startBit", "number", items[0]);
Qt_handleString("endBit", "number", items[1]);
}
}
} else if (!strcmp(token,"clr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if((!strcmp(widget, "caTextEntry")) || (!strcmp(widget, "caMessageButton")) || (!strcmp(widget, "caChoice")) ||
(!strcmp(widget, "caMenu")) || (!strcmp(widget, "caNumeric")) || (!strcmp(widget, "caSlider"))) {
int clr = atoi(token) % DL_MAX_COLORS;
Qt_setColorForeground("",displayInfo->dlColormap->dl_color[clr].r,
displayInfo->dlColormap->dl_color[clr].g,
displayInfo->dlColormap->dl_color[clr].b,
255);
} else {
//printf("adl2ui -- forecolor for control %s not supported (use stylesheet)\n", widget);
}
} else if (!strcmp(token,"bclr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if((!strcmp(widget, "caTextEntry")) || (!strcmp(widget, "caMessageButton"))|| (!strcmp(widget, "caChoice")) ||
(!strcmp(widget, "caMenu")) || (!strcmp(widget, "caNumeric")) || (!strcmp(widget, "caSlider"))) {
int bclr = atoi(token) % DL_MAX_COLORS;
Qt_setColorBackground("",displayInfo->dlColormap->dl_color[bclr].r,
displayInfo->dlColormap->dl_color[bclr].g,
displayInfo->dlColormap->dl_color[bclr].b,
255);
} else {
//printf("adl2ui -- backcolor for control %s not supported (use stylesheet)\n", widget);
}
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while ( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
}
void *parseImage(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int visibilityStatic = 0;
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caImage_%d", number++);
Qt_writeOpenTag("widget", "caImage", widgetName);
do {
switch( (tokenType = getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caImage", True);
} else if(!strcmp(token,"dynamic attribute")) {
parseDynamicAttribute(displayInfo,"caImage", &visibilityStatic);
} else if(!strcmp(token,"type")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
} else if(!strcmp(token,"image name")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_handleString("filename", "string", token);
} else if(!strcmp(token,"calc")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
Qt_handleString("imageCalc", "string", token);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
static int getWidthFromIncludeFile(DisplayInfo *displayInfo, char *filename,
int *compositeFileWidth, int *compositeFileHeight)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int savedVersionNumber;
FILE *savedFilePtr;
FILE *filePtr = fopen(filename, "r");
if(!filePtr) {
printf("\ncompositeFileParse: Cannot open file: %s\n", filename);
return False;
}
savedFilePtr = displayInfo->filePtr;
savedVersionNumber = displayInfo->versionNumber;
displayInfo->filePtr = filePtr;
parsingCompositeFile = True;
// Read the display block
tokenType=getToken(displayInfo,token);
if(tokenType == T_WORD && !strcmp(token,"display")) {
parseAndSkip(displayInfo);
tokenType=getToken(displayInfo,token);
}
// Read the colormap
if(tokenType == T_WORD && (!strcmp(token,"color map") ||
!strcmp(token,"<>"))) {
parseAndSkip(displayInfo);
tokenType=getToken(displayInfo,token);
}
while( (tokenType=getToken(displayInfo,token)) != T_EOF) {
if(tokenType == T_WORD && !strcmp(token,"width")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
*compositeFileWidth = atoi(token);
//printf("found width =%d instead off %d\n", atoi(token), newoffset->frameWidth);
}
if(tokenType == T_WORD && !strcmp(token,"height")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
*compositeFileHeight = atoi(token);
//printf("found height =%d instead off %d\n", atoi(token), newoffset->frameHeight);
break;
}
}
// Restore displayInfo file parameters
displayInfo->filePtr = savedFilePtr;
displayInfo->versionNumber = savedVersionNumber;
fclose(filePtr);
return True;
}
static void compositeFileParse(DisplayInfo *displayInfo, char *filename, DlObject *object,
FrameOffset *frameoffset,
FrameOffset *newoffset)
{
FILE *filePtr, *savedFilePtr;
int savedVersionNumber;
NameValueTable *savedNameValueTable = NULL;
int savedNumNameValues = 0;
char macroString[MAX_TOKEN_LENGTH];
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
char newFileName[LONGSTRING];
int compositeFileWidth = newoffset->frameWidth + 2;
int compositeFileHeight = newoffset->frameHeight + 2;
if(!displayInfo) return;
/* Separate filename and macros from dlComposite->compositeFile */
*macroString = '\0';
filename[MAX_TOKEN_LENGTH-1]='\0';
if(filename && filename[0]) {
/* Is of the form filename;a=xxx,b=yyy,... */
char *ptr = NULL;
ptr = strchr(filename, ';');
if(ptr) {
/* End the file name at the ; */
*ptr = '\0';
/* Copy the remainder to the macroString */
strcpy(macroString, ++ptr);
}
}
// filename
strcpy(newFileName, filePrefix);
strcat(newFileName, "/");
strcat(newFileName, filename);
// include file instead of flat parsing
if(!generateFlatFile) {
// we would like to correct the composite width and height, so open the file to find it
if(!getWidthFromIncludeFile(displayInfo, newFileName, &compositeFileWidth, &compositeFileHeight)) {
printf("\ncompositeFileParse: Cannot open file: %s\n", newFileName);
}
object->height = compositeFileHeight;
object->width = compositeFileWidth;
writeRectangleDimensions(object, frameoffset, "caFrame", True); // delayed write
newoffset->frameX = newoffset->frameX - frameoffset->frameX;
newoffset->frameY = newoffset->frameY - frameoffset->frameY;
newoffset->frameHeight = compositeFileHeight;
newoffset->frameWidth = compositeFileWidth;
writeRectangleDimensions(object, newoffset, "caInclude", False);
Qt_handleString("filename", "string", filename);
Qt_handleString("macro", "string", macroString);
return;
}
// generate flat file, not always so good
// we would like to correct the composite width and height, so open the file to find it
if(!getWidthFromIncludeFile(displayInfo, newFileName, &compositeFileWidth, &compositeFileHeight)) {
printf("\ncompositeFileParse: Cannot open file: %s\n", newFileName);
object->height = compositeFileHeight;
object->width = compositeFileWidth;
writeRectangleDimensions(object, frameoffset, "caFrame", True); // delayed write
return;
}
object->height = compositeFileHeight;
object->width = compositeFileWidth;
writeRectangleDimensions(object, frameoffset, "caFrame", True); // delayed write
// now use the original parsing
//printf("compositeFileParse file=%s macro=%s\n", filename, macroString);
savedFilePtr = displayInfo->filePtr;
savedVersionNumber = displayInfo->versionNumber;
// Open the file
filePtr = fopen(newFileName, "r");
if(!filePtr) {
printf("\ncompositeFileParse: Cannot open file: %s\n", newFileName);
return;
}
parsingCompositeFile = True;
displayInfo->filePtr = filePtr;
// Only do this if there is a macro string, otherwise use the existing macros
if(*macroString) {
int numPairs;
savedNameValueTable = displayInfo->nameValueTable;
savedNumNameValues = displayInfo->numNameValues;
displayInfo->nameValueTable =
generateNameValueTable(macroString, &numPairs);
displayInfo->numNameValues = numPairs;
Qt_handleString("macro", "string", macroString);
}
// Read the file block (Must be there)
// If first token isn't "file" then bail out
tokenType=getToken(displayInfo,token);
if(tokenType == T_WORD && !strcmp(token,"file")) {
parseAndSkip(displayInfo);
} else {
printf("compositeFileParse: Invalid .adl file (First block is not file block) file: %s\n",filename);
fclose(filePtr);
goto RETURN;
}
// Read the display block
tokenType=getToken(displayInfo,token);
if(tokenType == T_WORD && !strcmp(token,"display")) {
parseAndSkip(displayInfo);
tokenType=getToken(displayInfo,token);
}
// Read the colormap
if(tokenType == T_WORD &&
(!strcmp(token,"color map") ||
!strcmp(token,"<>"))) {
parseAndSkip(displayInfo);
tokenType=getToken(displayInfo,token);
}
// Proceed with parsing
while(parseAndAppendDisplayList(displayInfo, newoffset, token, tokenType) != T_EOF) {
tokenType=getToken(displayInfo,token);
}
RETURN:
// Restore displayInfo file parameters
displayInfo->filePtr = savedFilePtr;
displayInfo->versionNumber = savedVersionNumber;
if(*macroString) {
free ((char *)displayInfo->nameValueTable);
displayInfo->nameValueTable = savedNameValueTable;
displayInfo->numNameValues = savedNumNameValues;
}
parsingCompositeFile = False;
fclose(filePtr);
}
void *parseComposite(DisplayInfo *displayInfo, FrameOffset *offset)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
DlObject *object;
char compositeName[MAX_TOKEN_LENGTH];
char compositeFile[MAX_TOKEN_LENGTH];
int visibilityStatic = 0;
int includeSet = False;
static int number = 0;
char widgetName[MAX_ASCII];
FrameOffset *frameoffset;
FrameOffset *actoffset;
FrameOffset *newoffset;
object = (DlObject *)malloc(sizeof(DlObject));
frameoffset = (FrameOffset *)malloc(sizeof(FrameOffset));
actoffset = (FrameOffset *)malloc(sizeof(FrameOffset));
do {
switch(tokenType=getToken(displayInfo,token)) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, object);
// do not write yet any dimensions, have to be delayed for composite file to add width and height
frameoffset = offset;
actoffset->frameX = object->x;
actoffset->frameY = object->y;
offset=actoffset;
/*
printf("parseobject object=%d %d actoffset=%d %d\n", object->x, object->y,
actoffset->frameX, actoffset->frameY);
*/
} else if(!strcmp(token,"dynamic attribute")) {
// dynamic attribute is normally after composite file
if(!includeSet) {
parseDynamicAttribute(displayInfo, "caFrame", &visibilityStatic);
} else {
parseDynamicAttribute(displayInfo, "caInclude", &visibilityStatic);
}
} else if(!strcmp(token,"composite name")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(compositeName,token);
} else if(!strcmp(token,"composite file")) {
newoffset = (FrameOffset *)malloc(sizeof(FrameOffset));
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(compositeFile,token);
// will be an caInclude
if(!generateFlatFile) {
includeSet = True;
sprintf(widgetName, "caInclude_%d", number++);
Qt_writeOpenTag("widget", "caInclude", widgetName);
newoffset->frameX = object->x;
newoffset->frameY = object->y;
newoffset->frameWidth = object->width;
newoffset->frameHeight = object->height;
// will be a caFrame
} else {
sprintf(widgetName, "caFrame_%d", number++);
Qt_writeOpenTag("widget", "caFrame", widgetName);
newoffset->frameX = 0;
newoffset->frameY = 0;
newoffset->frameWidth = object->width;
newoffset->frameHeight = object->height;
}
/*
printf("parsefile object=%d %d frameoffset=%d %d newoffset = %d %d\n", object->x, object->y,
frameoffset->frameX, frameoffset->frameY,
newoffset->frameX, newoffset->frameY);
*/
compositeFileParse(displayInfo, compositeFile, object, frameoffset, newoffset);
} else if(!strcmp(token,"children")) {
FrameOffset *newoffset;
sprintf(widgetName, "caFrame_%d", number++);
Qt_writeOpenTag("widget", "caFrame", widgetName);
newoffset = (FrameOffset *)malloc(sizeof(FrameOffset));
newoffset->frameX = offset->frameX;
newoffset->frameY = offset->frameY;
/*
printf("children object=%d %d newoffset = %d %d\n", object->x, object->y, newoffset->frameX, newoffset->frameY);
*/
tokenType=getToken(displayInfo,token);
writeRectangleDimensions(object, frameoffset, "caFrame", True); // delayed write
parseAndAppendDisplayList(displayInfo, newoffset, token, tokenType);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
#define INITIAL_NUM_POINTS 16
void parsePolygonPoints(DisplayInfo *displayInfo, char *widget, int offsetX, int offsetY)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel;
int x, y;
char points[LONGSTRING];
UNUSED(widget);
points[0] = '\0';
nestingLevel = 0;
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"(")) {
getToken(displayInfo,token);
x = atoi(token);
getToken(displayInfo,token); // separator
getToken(displayInfo,token);
y = atoi(token);
getToken(displayInfo,token); // ")"
sprintf(points, "%s%d,%d;", points, x-offsetX, y-offsetY);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
if(strlen(points) > 0) Qt_handleString("xyPairs", "string", points);
}
void *parseWheelSwitch(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
char COLORMODE[MAX_TOKEN_LENGTH] = "static";
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int visibilityStatic = 2; // top layer
int formatFound=False;
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caNumeric_%d", number++);
Qt_writeOpenTag("widget", "caNumeric", widgetName);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caNumeric", True);
} else if(!strcmp(token,"control")) {
parseControl(displayInfo, "caNumeric");
} else if(!strcmp(token,"clrmod")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(COLORMODE, token);
} else if(!strcmp(token,"limits")) {
parseLimits(displayInfo, "caNumeric", 0, formatFound);
} else if(!strcmp(token,"format")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
formatFound = True;
Qt_setWheelSwitchForm("", token);
Qt_setPrecisionSource("caNumeric", 0, "Default");
Qt_handleString("fixedFormat", "bool", "true");
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
Qt_handleString("autoFillBackground", "bool", "true");
Qt_handleString("digitsFontScaleEnabled", "bool", "true");
if(!formatFound) Qt_handleString("fixedFormat", "bool", "false");
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void *parsePolygon(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int visibilityStatic = 0;
int offsetX=0, offsetY=0;
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caPolygon_%d", number++);
Qt_writeOpenTag("widget", "caPolyLine", widgetName);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caPolyLine", True);
offsetX = object.x;
offsetY = object.y;
} else {
if(!strcmp(token,"basic attribute"))
parseBasicAttribute(displayInfo, "caPolyLine");
else
if(!strcmp(token,"dynamic attribute"))
parseDynamicAttribute(displayInfo, "caPolyLine", &visibilityStatic);
else
if(!strcmp(token,"points"))
parsePolygonPoints(displayInfo, "caPolyLine", offsetX, offsetY);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
Qt_handleString("polystyle", "enum", "caPolyLine::Polygon");
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void *parseRectangle(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int visibilityStatic = 0;
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caRectangle_%d", number++);
Qt_writeOpenTag("widget", "caGraphics", widgetName);
Qt_handleString("form", "enum", "caGraphics::Rectangle");
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caGraphics", True);
} else if(!strcmp(token,"basic attribute")) {
parseBasicAttribute(displayInfo, "caGraphics");
} else if(!strcmp(token,"dynamic attribute")) {
parseDynamicAttribute(displayInfo, "caGraphics", &visibilityStatic);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void *parseOval(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int visibilityStatic = 0;
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caGraphics_%d", number++);
Qt_writeOpenTag("widget", "caGraphics", widgetName);
Qt_handleString("form", "enum", "caGraphics::Circle");
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caGraphics", True);
} else if(!strcmp(token,"basic attribute")) {
parseBasicAttribute(displayInfo, "caGraphics");
} else if(!strcmp(token,"dynamic attribute")) {
parseDynamicAttribute(displayInfo, "caGraphics", &visibilityStatic);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void *parseArc(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
char asc[MAX_ASCII];
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int visibilityStatic = 0;
int startAngle = 0;
int spanAngle = 0;
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caArc_%d", number++);
Qt_writeOpenTag("widget", "caGraphics", widgetName);
Qt_handleString("form", "enum", "caGraphics::Arc");
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if (!strcmp(token,"object"))
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caGraphics", True);
if (!strcmp(token,"basic attribute")) {
parseBasicAttribute(displayInfo, "caGraphics");
} else {
if (!strcmp(token,"dynamic attribute")) {
parseDynamicAttribute(displayInfo, "caGraphics", &visibilityStatic);
} else {
if (!strcmp(token,"begin")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
startAngle = atoi(token);
sprintf(asc, "%d", startAngle / 64);
Qt_handleString("startAngle", "number", asc);
} else
if (!strcmp(token,"path")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
spanAngle = atoi(token);
sprintf(asc, "%d", spanAngle / 64);
Qt_handleString("spanAngle", "number", asc);
}
}
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void *parseText(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
char textix[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int alignFound=False;
int visibilityStatic = 0;
unsigned int newWidth = 0;
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caLabel_%d", number++);
Qt_writeOpenTag("widget", "caLabel", widgetName);
Qt_handleString("frameShape", "enum", "QFrame::NoFrame");
textix[0] = '\0';
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
//writeRectangleDimensions(&object, offset, "caLabel", True);
} else if(!strcmp(token,"basic attribute")) {
parseBasicAttribute(displayInfo, "caLabel");
} else if(!strcmp(token,"dynamic attribute")) {
parseDynamicAttribute(displayInfo, "caLabel", &visibilityStatic);
}
else if(!strcmp(token,"textix")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(textix, token);
Qt_handleString("text", "string", token);
Qt_handleString("fontScaleMode", "enum", "ESimpleLabel::WidthAndHeight");
} else if(!strcmp(token,"align")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(strstr(token, "left") != (char*) 0) {
alignFound = True;
Qt_handleString("alignment", "set", "Qt::AlignAbsolute|Qt::AlignLeft|Qt::AlignVCenter");
} else if(strstr(token, "centered") != (char*) 0) {
alignFound = True;
Qt_handleString("alignment", "set", "Qt::AlignAbsolute|Qt::AlignHCenter|Qt::AlignVCenter");
} else if(strstr(token, "right") != (char*) 0) {
alignFound = True;
Qt_handleString("alignment", "set", "Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignVCenter");
}
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
if(strlen(textix) > 0) {
newWidth = .6 * object.height * strlen(textix);
if(newWidth > object.width) object.width = newWidth;
}
writeRectangleDimensions(&object, offset, "caLabel", True);
if(!alignFound) Qt_handleString("alignment", "set", "Qt::AlignAbsolute|Qt::AlignLeft|Qt::AlignVCenter");
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void parsePolylinePoints(DisplayInfo *displayInfo, char *widget, int offsetX, int offsetY)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel;
int x, y;
char points[LONGSTRING];
UNUSED(widget);
points[0] = '\0';
nestingLevel = 0;
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"(")) {
getToken(displayInfo,token);
x = atoi(token);
getToken(displayInfo,token); // separator
getToken(displayInfo,token);
y = atoi(token);
getToken(displayInfo,token); // ")"
sprintf(points, "%s%d,%d;", points, x-offsetX, y-offsetY);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
if(strlen(points) > 0) Qt_handleString("xyPairs", "string", points);
}
void *parsePolyline(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int offsetX=0, offsetY=0;
int visibilityStatic = 0;
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caPolyLine_%d", number++);
Qt_writeOpenTag("widget", "caPolyLine", widgetName);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caPolyLine", True);
offsetX = object.x;
offsetY = object.y;
} else if(!strcmp(token,"basic attribute")) {
parseBasicAttribute(displayInfo, "caPolyLine");
} else if(!strcmp(token,"dynamic attribute")) {
parseDynamicAttribute(displayInfo, "caPolyLine", &visibilityStatic);
} else if(!strcmp(token,"points")) {
parsePolylinePoints(displayInfo, "caPolyLine", offsetX, offsetY);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
void *parseBar(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
char COLORMODE[MAX_TOKEN_LENGTH] = "static";
char look[MAX_TOKEN_LENGTH] = "noDeco";
char direction[MAX_TOKEN_LENGTH] = "Right";
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int visibilityStatic = 2; // top layer
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caThermo_%d", number++);
Qt_writeOpenTag("widget", "caThermo", widgetName);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
if(object.width < 3) object.width=3;
if(object.height < 3) object.height=3;
writeRectangleDimensions(&object, offset, "caThermo", True);
} else if(!strcmp(token,"monitor")) {
parseMonitor(displayInfo, "caThermo");
} else if(!strcmp(token,"label")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!strcmp(token,"none")) {
strcpy(look, "noLabel");
} else if(!strcmp(token,"no decorations")) {
strcpy(look, "noDeco");
} else if(!strcmp(token,"outline")) {
strcpy(look, "Outline");
} else if(!strcmp(token,"limits")) {
strcpy(look, "Limits");
} else {
if(!strcmp(token,"channel")) {
strcpy(look, "channelV");
}
}
} else if(!strcmp(token,"clrmod")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(COLORMODE, token);
} else if(!strcmp(token,"direction")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!strcmp(token,"up")) {
strcpy(direction, "Up");
} else if(!strcmp(token,"right")) {
strcpy(direction, "Right");
} else if(!strcmp(token,"down")) {
strcpy(direction, "Down");
} else if(!strcmp(token,"left")) {
strcpy(direction, "Left");
}
} else if(!strcmp(token,"fillmod")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!strcmp(token,"from edge")) {
} else if(!strcmp(token,"from center")) {
Qt_handleString("type", "enum", "QwtThermoMarker::PipeFromCenter");
}
} else if(!strcmp(token,"limits")) {
parseLimits(displayInfo, "caThermo", 0, False);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
Qt_handleString("direction", "enum", direction);
Qt_handleString("look", "enum", look);
if(!strcmp(look,"noLabel") || !strcmp(look,"noDeco")) {
char pipeWidth[10];
Qt_handleString("scalePosition", "enum", "NoScale");
if(!strcmp(direction, "Up") || !strcmp(direction, "Down")) {
sprintf(pipeWidth, "%d", object.width);
Qt_handleString("pipeWidth", "number", pipeWidth);
} else {
sprintf(pipeWidth, "%d", object.height);
Qt_handleString("pipeWidth", "number", pipeWidth);
}
} else if(!strcmp(direction, "Up") || !strcmp(direction, "Down")) {
Qt_handleString("scalePosition", "enum", "LeftScale");
} else if(!strcmp(direction, "Right") || !strcmp(direction, "Left")) {
Qt_handleString("scalePosition", "enum", "BottomScale");
}
Qt_setColorMode("caThermo", COLORMODE);
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void *) 0;
}
void *parseIndicator(DisplayInfo *displayInfo, FrameOffset * offset)
{
char token[MAX_TOKEN_LENGTH];
char COLORMODE[MAX_TOKEN_LENGTH] = "static";
char look[MAX_TOKEN_LENGTH] = "noDeco";
char direction[MAX_TOKEN_LENGTH] = "Right";
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int visibilityStatic = 2; // top layer
char pipeWidth[10];
static int number = 0;
char widgetName[MAX_ASCII];
sprintf(widgetName, "caThermoM_%d", number++);
Qt_writeOpenTag("widget", "caThermo", widgetName);
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, offset, "caThermo", True);
} else if(!strcmp(token,"monitor")) {
parseMonitor(displayInfo, "caThermo");
} else if(!strcmp(token,"label")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!strcmp(token,"none")) {
strcpy(look, "noLabel");
} else if(!strcmp(token,"no decorations")) {
strcpy(look, "noDeco");
} else if(!strcmp(token,"outline")) {
strcpy(look, "Outline");
} else if(!strcmp(token,"limits")) {
strcpy(look, "Limits");
} else {
if(!strcmp(token,"channel")) {
strcpy(look, "channelV");
}
}
} else if(!strcmp(token,"clrmod")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
strcpy(COLORMODE, token);
} else if(!strcmp(token,"direction")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
if(!strcmp(token,"up")) {
strcpy(direction, "Up");
} else if(!strcmp(token,"right")) {
strcpy(direction, "Right");
} else if(!strcmp(token,"down")) {
strcpy(direction, "Down");
} else if(!strcmp(token,"left")) {
strcpy(direction, "Left");
}
} else if(!strcmp(token,"limits")) {
parseLimits(displayInfo, "caThermo", 0, False);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
Qt_handleString("direction", "enum", direction);
Qt_handleString("look", "enum", look);
if(!strcmp(look,"noLabel") || !strcmp(look,"noDeco")) {
Qt_handleString("scalePosition", "enum", "NoScale");
Qt_handleString("scalePosition", "enum", "NoScale");
if(!strcmp(direction, "Up") || !strcmp(direction, "Down")) {
sprintf(pipeWidth, "%d", object.width-4);
Qt_handleString("pipeWidth", "number", pipeWidth);
} else {
sprintf(pipeWidth, "%d", object.height-4);
Qt_handleString("pipeWidth", "number", pipeWidth);
}
} else if(!strcmp(direction, "Up") || !strcmp(direction, "Down")) {
Qt_handleString("scalePosition", "enum", "LeftScale");
} else if(!strcmp(direction, "Right") || !strcmp(direction, "Left")) {
Qt_handleString("scalePosition", "enum", "BottomScale");
}
Qt_handleString("type", "enum", "QwtThermoMarker::Marker");
Qt_setColorMode("caThermo", COLORMODE);
Qt_writeCloseTag("widget", widgetName, visibilityStatic);
return (void*) 0;
}
TOKEN getToken(DisplayInfo *displayInfo, char *word)
{
FILE *filePtr;
enum {NEUTRAL,INQUOTE,INWORD,INMACRO} state = NEUTRAL, savedState = NEUTRAL;
int c;
char *w, *value;
char *m, macro[MAX_TOKEN_LENGTH];
int j;
filePtr = displayInfo->filePtr;
w = word;
m = macro;
while( (c=getc(filePtr)) != EOF) {
switch (state) {
case NEUTRAL:
switch(c) {
case '=' : return(T_EQUAL);
case '{' : return(T_LEFT_BRACE);
case '}' : return(T_RIGHT_BRACE);
case '"' : state = INQUOTE;
break;
/*
case '$' : c=getc(filePtr);
// only do macro substitution if in execute mode or parsing a composite file
if((parsingCompositeFile) && c == '(' ) {
state = INMACRO;
} else {
*w++ = '$';
*w++ = c;
}
*/
break;
case ' ' :
case '\t':
case '\r':
case '\n': break;
/* for constructs of the form (a,b) */
case '(' :
case ',' :
case ')' : *w++ = c; *w = '\0'; return(T_WORD);
default : state = INWORD;
*w++ = c;
break;
}
break;
case INQUOTE:
switch(c) {
case '"' : *w = '\0'; return(T_WORD);
break;
default : *w++ = c;
break;
}
break;
case INMACRO:
switch(c) {
case ')' : *m = '\0';
value = lookupNameValue(displayInfo->nameValueTable,
displayInfo->numNameValues,macro);
if(value != NULL) {
for(j = 0; j < (int) strlen(value); j++) {
*w++ = value[j];
}
} else {
*w++ = '$';
*w++ = '(';
for(j = 0; j < (int) strlen(macro); j++) {
*w++ = macro[j];
}
*w++ = ')';
}
state = savedState;
m = macro;
break;
default : *m++ = c;
break;
}
break;
case INWORD:
switch(c) {
case ' ' :
case '\r':
case '\n':
case '\t':
case '=' :
case '(' :
case ',' :
case ')' :
case '"' : ungetc(c,filePtr); *w = '\0'; return(T_WORD);
default : *w++ = c;
break;
}
break;
}
}
return(T_EOF);
}
/*** Parsing routines ***/
void *getNextElement(DisplayInfo *pDI, char *token, FrameOffset *offset) {
int i;
for(i=0; i < parseFuncTableSize; i++) {
if(!strcmp(token,parseFuncTable[i].name)) {
return (void *) parseFuncTable[i].func(pDI, offset);
}
}
return 0;
}
TOKEN parseAndAppendDisplayList(DisplayInfo *displayInfo, FrameOffset *offset, char *firstToken, TOKEN firstTokenType)
{
TOKEN tokenType;
char token[MAX_TOKEN_LENGTH];
int nestingLevel = 0;
int first = 1;
static int veryFirst = True;
int bclr = 0;
if(veryFirst) {
veryFirst = False;
bclr = displayInfo->drawingAreaBackgroundColor;
Qt_writeStyleSheet(displayInfo->dlColormap->dl_color[bclr].r,
displayInfo->dlColormap->dl_color[bclr].g,
displayInfo->dlColormap->dl_color[bclr].b);
Qt_writeOpenTag("widget", "QWidget", "centralWidget");
}
/* Loop over tokens until T_EOF */
do {
if(first) {
tokenType=firstTokenType;
strcpy(token,firstToken);
first = 0;
} else {
tokenType=getToken(displayInfo,token);
}
switch(tokenType) {
case T_WORD : {
getNextElement(displayInfo, token, offset);
break;
}
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++; break;
case T_RIGHT_BRACE:
nestingLevel--; break;
default :
break;
}
} while((tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF));
/* Reset the init flag */
return tokenType;
}
void *parseDisplay(DisplayInfo *displayInfo)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
DlObject object;
int clr, bclr;
char cmap[MAX_TOKEN_LENGTH];
FrameOffset offset;
offset.frameX = offset.frameY =0;
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"object")) {
parseObject(displayInfo, &object);
writeRectangleDimensions(&object, &offset, "", True);
} else if(!strcmp(token,"grid")) {
parseGrid(displayInfo, "");
} else if(!strcmp(token,"cmap")) {
/* Parse separate display list to get and use that colormap */
getToken(displayInfo,token);
getToken(displayInfo,token);
if(strlen(token) > (size_t) 0) {
strcpy(cmap,token);
}
} else if(!strcmp(token,"bclr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
bclr = atoi(token) % DL_MAX_COLORS;
displayInfo->drawingAreaBackgroundColor = bclr;
} else if(!strcmp(token,"clr")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
clr = atoi(token) % DL_MAX_COLORS;
displayInfo->drawingAreaForegroundColor = clr;
} else if(!strcmp(token,"gridSpacing")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
} else if(!strcmp(token,"gridOn")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
} else if(!strcmp(token,"snapToGrid")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
return (void*) 0;
}
void parseFile(DisplayInfo *displayInfo)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"name")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
}
if(!strcmp(token,"version")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
//return dlFile;
}
void parseDlColor(DisplayInfo *displayInfo, FILE *filePtr,
DlColormapEntry *dlColor)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
int counter = 0;
FILE *savedFilePtr;
/* (MDA) have to be sneaky for these colormap parsing routines: *
* since possibly external colormap, save and restore * external file
* ptr in displayInfo so that getToken() * works with displayInfo and
* not the filePtr directly */
savedFilePtr = displayInfo->filePtr;
displayInfo->filePtr = filePtr;
do {
switch( (tokenType=getToken(displayInfo, token)) ) {
case T_WORD: {
char *end;
unsigned long color = strtoul(token,&end,16);
if(counter < DL_MAX_COLORS) {
dlColor[counter].r = (color & 0x00ff0000) >> 16;
dlColor[counter].g = (color & 0x0000ff00) >> 8;
dlColor[counter].b = color & 0x000000ff;
counter++;
}
getToken(displayInfo,token);
break;
}
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
/* Restore displayInfo->filePtr to previous value */
displayInfo->filePtr = savedFilePtr;
}
void parseOldDlColor(DisplayInfo *displayInfo, FILE *filePtr,
DlColormapEntry *dlColor)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
FILE *savedFilePtr;
/*
* (MDA) have to be sneaky for these colormap parsing routines:
* since possibly external colormap, save and restore
* external file ptr in displayInfo so that getToken()
* works with displayInfo and not the filePtr directly
*/
savedFilePtr = displayInfo->filePtr;
displayInfo->filePtr = filePtr;
do {
switch( (tokenType=getToken(displayInfo,token)) ) {
case T_WORD:
if(!strcmp(token,"r")) {
getToken(displayInfo,token);getToken(displayInfo,token);
dlColor->r = atoi(token);
} else if(!strcmp(token,"g")) {
getToken(displayInfo,token);getToken(displayInfo,token);
dlColor->g = atoi(token);
} else if(!strcmp(token,"b")) {
getToken(displayInfo,token);getToken(displayInfo,token);
dlColor->b = atoi(token);
} else if(!strcmp(token,"inten")) {
getToken(displayInfo,token);getToken(displayInfo,token);
dlColor->inten = atoi(token);
}
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while( (tokenType != T_RIGHT_BRACE) && (nestingLevel > 0)
&& (tokenType != T_EOF) );
/* and restore displayInfo->filePtr to previous value */
displayInfo->filePtr = savedFilePtr;
}
DlColormap *createDlColormap(DisplayInfo *displayInfo)
{
DlColormap *dlColormap;
UNUSED(displayInfo);
dlColormap = (DlColormap *)malloc(sizeof(DlColormap));
if(!dlColormap) return 0;
/* structure copy */
*dlColormap = defaultDlColormap;
return(dlColormap);
}
DlColormap *parseColormap(DisplayInfo *displayInfo, FILE *filePtr)
{
char token[MAX_TOKEN_LENGTH];
TOKEN tokenType;
int nestingLevel = 0;
DlColormap *dlColormap;
DlColormapEntry dummyColormapEntry;
DlColormapEntry dl_color[DL_MAX_COLORS];
int counter;
FILE *savedFilePtr;
dlColormap = createDlColormap(displayInfo);
if(!dlColormap) return NULL;
savedFilePtr = displayInfo->filePtr;
displayInfo->filePtr = filePtr;
/* initialize some data in structure */
dlColormap->ncolors = 0;
/* new colormap, get values (pixel values are being stored) */
counter = 0;
do {
switch( (tokenType=getToken(displayInfo, token)) ) {
case T_WORD:
if(!strcmp(token,"ncolors")) {
getToken(displayInfo,token);
getToken(displayInfo,token);
dlColormap->ncolors = atoi(token);
if(dlColormap->ncolors > DL_MAX_COLORS) {
printf("\nMaximum # of colors in colormap exceeded\n"
" Will continue with truncated color space\n"
"(You may want to change the colors of some objects)\n");
//dmSetAndPopupWarningDialog(displayInfo, msg,"OK",NULL,NULL);
}
} else if(!strcmp(token,"dl_color")) {
/* continue parsing but throw away "excess" colormap entries */
if(counter < DL_MAX_COLORS) {
parseOldDlColor(displayInfo,filePtr,&(dl_color[counter]));
counter++;
} else {
parseOldDlColor(displayInfo,filePtr,&dummyColormapEntry);
counter++;
}
} else if(!strcmp(token,"colors")) {
parseDlColor(displayInfo,filePtr, dl_color);
}
break;
case T_EQUAL:
break;
case T_LEFT_BRACE:
nestingLevel++;
break;
case T_RIGHT_BRACE:
nestingLevel--;
break;
default:
break;
}
} while((tokenType != T_RIGHT_BRACE) && (nestingLevel > 0) &&
(tokenType != T_EOF));
/* restore the previous filePtr */
displayInfo->filePtr = savedFilePtr;
return (dlColormap);
}
caQtDM_Viewer/parser/parser.h 0000644 0002101 0021616 00000006421 12315302333 015315 0 ustar mezger sls /*
* This file is part of the caQtDM Framework, developed at the Paul Scherrer Institut,
* Villigen, Switzerland
*
* The caQtDM Framework 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 3 of the License, or
* (at your option) any later version.
*
* The caQtDM Framework 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 the caQtDM Framework. If not, see .
*
* Copyright (c) 2010 - 2014
*
* Author:
* Anton Mezger
* Contact details:
* anton.mezger@psi.ch
*/
#ifndef PARSER_H
#define PARSER_H
#ifdef __cplusplus
extern "C" {
#endif
#include
#include
#include
#include
#include
#include
#include
#ifndef MAX
#define MAX(a,b) ((a)>(b)?(a):(b))
#endif
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
#endif
#ifndef STRDUP
#define STRDUP(a) (strcpy( (char *)malloc(strlen(a)+1),a))
#endif
#define LONGSTRING 4096
#define MAX_ASCII 80 /* max size of many asci strings */
#define MAX_TOKEN_LENGTH 256 /* max size of strings in adl */
#define MAX_PENS 8 /* max # of pens on strip chart */
#define MAX_TRACES 8 /* max # of traces on cart. plot */
#define MAX_FILE_CHARS 256 /* max # of chars in filename */
#define MAX_CALC_RECORDS 4 /* max # of records for calc */
#define MAX_CALC_INPUTS 12 /* max # of inputs for calc */
#define DL_MAX_COLORS 65 /* max # of colors for display */
#define DL_COLORS_COLUMN_SIZE 5 /* # of colors in each column */
#if MAX_CALC_RECORDS != 4
#error Need to make changes (CALC_A_RC, etc.) if MAX_CALC_RECORDS != 4
#endif
typedef struct {
int x, y;
unsigned int width, height;
} DlObject;
typedef struct {
int frameX, frameY;
int frameWidth, frameHeight;
} FrameOffset;
typedef struct {
int r, g, b;
int inten;
} DlColormapEntry;
typedef struct {
DlObject object;
int clr, bclr;
char cmap[MAX_TOKEN_LENGTH];
} DlDisplay;
typedef struct {
int ncolors;
DlColormapEntry dl_color[DL_MAX_COLORS];
} DlColormap;
#define X_AXIS_ELEMENT 0
#define Y1_AXIS_ELEMENT 1
#define Y2_AXIS_ELEMENT 2
/* Name-value table (for macro substitutions in display files) */
typedef struct {
char *name;
char *value;
} NameValueTable;
typedef struct _DisplayInfo {
FILE *filePtr;
int versionNumber;
int drawingAreaBackgroundColor;
int drawingAreaForegroundColor;
DlColormap *dlColormap;
NameValueTable *nameValueTable;
int numNameValues;
} DisplayInfo;
typedef enum
{ T_WORD, T_EQUAL, T_QUOTE, T_LEFT_BRACE, T_RIGHT_BRACE, T_EOF} TOKEN;
#define MAX_RELATED_DISPLAYS 16
#define MAX_SHELL_COMMANDS 16
#define SC_DEFAULT_UNITS SECONDS
#define True 1==1
#define False !True
#define Boolean unsigned int
#ifdef __cplusplus
}
#endif
#endif
caQtDM_Viewer/parser/parser.pro 0000644 0002101 0021616 00000001605 12315302333 015665 0 ustar mezger sls include(../qtdefs.pri)
contains(QT_VER_MAJ, 5) {
QT += widgets
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x000000
}
TEMPLATE = app
INCLUDEPATH += .
MOC_DIR = moc
OBJECTS_DIR = obj
DESTDIR = .
# Input
HEADERS += XmlWriter.h parser.h \
myParser.h \
QtProperties.h \
dmsearchfile.h
SOURCES += myParser.cpp XmlWriter.cpp parser.c \
QtProperties.c \
dmsearchfile.cpp
TARGET = adl2ui
OTHER_FILES += \
stylesheet.qss
DEFINES += BUILDVERSION=\\\"$${CAQTDM_VERSION}\\\"
DEFINES += BUILDARCH=\\\"$$(QMAKESPEC)\\\"
unix:!macx {
QMAKE_POST_LINK = cp adl2ui ../../caQtDM_Binaries/
}
macx: {
QMAKE_POST_LINK = cp -R ./adl2ui.app ../../caQtDM_Binaries/
}
win32-msvc* {
CONFIG += console
ReleaseBuild {
QMAKE_POST_LINK = $${QMAKE_COPY} .\\release\\adl2ui.exe ..\..\caQtDM_Binaries
OBJECTS_DIR = release/obj
}
DebugBuild {
OBJECTS_DIR = debug/obj
}
}
caQtDM_Viewer/parser/stylesheet.qss 0000644 0002101 0021616 00000004314 12315302333 016570 0 ustar mezger sls caTable {
font: 10pt;
background: cornsilk;
alternate-background-color: wheat;
}
caLineEdit {
border-radius: 1px;
background: lightyellow;
color: black;
}
caTextEntry {
color: rgb(127, 0, 63);
background-color: cornsilk;
selection-color: #0a214c;
selection-background-color: wheat;
border: 1px groove black;
border-radius: 1px;
padding: 1px;
}
caTextEntry:focus {
padding: 0px;
border: 2px groove darkred;
border-radius: 1px;
}
QPushButton {
border-color: #00b;
border-radius: 2px;
padding: 3px;
border-width: 1px;
background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,
stop:0 rgba(224, 239, 255, 255),
stop:0.5 rgba(199, 215, 230, 255),
stop:1 rgba(184, 214, 236, 255));
}
QPushButton:hover {
background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,
stop:0 rgba(201, 226, 255, 255),
stop:0.5 rgba(177, 204, 230, 255),
stop:1 rgba(163, 205, 236, 255));
}
QPushButton:pressed {
background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,
stop:0 rgba(174, 219, 255, 255),
stop:0.5 rgba(165, 199, 230, 255),
stop:1 rgba(134, 188, 236, 255));
}
QPushButton:disabled {
background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,
stop:0 rgba(174, 219, 255, 255),
stop:0.5 rgba(165, 199, 230, 255),
stop:1 rgba(134, 188, 236, 255));
}
caChoice {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
}
caChoice > QPushButton {
text-align: left;
padding: 1px;
}
/* when font specified, no font sizing is done any more, font: 10pt; is not bad. You could Enable this when you converted from .adl files
caRelatedDisplay > QPushButton {
font: 10pt;
}
caShellCommand > QPushButton {
font: 10pt;
}
*/
caSlider::groove:horizontal {
border: 1px solid #bbb;
background: lightgrey;
height: 20px;
border-radius: 4px;
}
caSlider::handle:horizontal {
background: red;
border: 1px solid #777;
width: 13px;
margin-top: -2px;
margin-bottom: -2px;
border-radius: 2px;
}
caQtDM_Viewer/parser/winbuild.bat 0000644 0002101 0021616 00000000460 12315302333 016152 0 ustar mezger sls echo on
echo Setting up environment for Qt usage...
set QTDIR=C:\QtSDK\Desktop\Qt\4.8.1\mingw
set PATH=%QTDIR%\bin;%PATH%
set PATH=C:\QtSDK\mingw\bin;%PATH%
qmake myParser.pro
c:\QtSDK\mingw\bin\mingw32-make.exe -f Makefile.release clean
c:\QtSDK\mingw\bin\mingw32-make.exe -f Makefile.release
caQtDM_Viewer/parser/winparser.bat 0000644 0002101 0021616 00000000251 12315302333 016345 0 ustar mezger sls echo on
set QTDIR=C:\QtSDK\Desktop\Qt\4.8.1\mingw
set PATH=%QTDIR%\bin;%PATH%
set PATH=C:\QtSDK\mingw\bin;%PATH%
c:\work\caQtDM\parser\release\myParser -flat comet
caQtDM_Viewer/parser/parser.pro.user 0000600 0002101 0021616 00000030705 12401340755 016643 0 ustar mezger sls
ProjectExplorer.Project.ActiveTarget
0
ProjectExplorer.Project.EditorSettings
true
false
true
Cpp
CppGlobal
QmlJS
QmlJSGlobal
2
UTF-8
false
4
false
true
1
true
0
true
0
8
true
1
true
true
true
false
ProjectExplorer.Project.PluginSettings
ProjectExplorer.Project.Target.0
Qt 4.8.2 in PATH (Qt-4.8.2)
Qt 4.8.2 in PATH (Qt-4.8.2)
{ed8705b8-ad5a-4735-b3e0-f2dc741748e3}
0
0
0
true
qmake
QtProjectManager.QMakeBuildStep
false
false
false
true
Make
Qt4ProjectManager.MakeStep
false
2
Build
ProjectExplorer.BuildSteps.Build
true
Make
Qt4ProjectManager.MakeStep
true
clean
1
Clean
ProjectExplorer.BuildSteps.Clean
2
false
Release
Qt4ProjectManager.Qt4BuildConfiguration
0
/afs/psi.ch/user/m/mezger/workarea/ACS/mezger/caQtDM_Project/caQtDM_Viewer/parser
false
1
0
Deploy
ProjectExplorer.BuildSteps.Deploy
1
Deploy locally
ProjectExplorer.DefaultDeployConfiguration
1
true
false
false
false
false
true
0.01
10
true
25
true
valgrind
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
parser
Qt4ProjectManager.Qt4RunConfiguration:/afs/psi.ch/user/m/mezger/workarea/ACS/mezger/caQtDM_Project/caQtDM_Viewer/parser/parser.pro
2
parser.pro
false
false
3768
true
false
false
true
1
ProjectExplorer.Project.TargetCount
1
ProjectExplorer.Project.Updater.EnvironmentId
{0c791b27-ab80-4fca-b24f-ffc8d2dbe289}
ProjectExplorer.Project.Updater.FileVersion
12
caQtDM_Viewer/bis_ama1.ui 0000644 0002101 0021616 00000155212 12364377705 014415 0 ustar mezger sls
MainWindow
0
0
1550
850
QWidget#centralWidget {background: rgb(200, 200, 200);}
caTable {
background: cornsilk;
alternate-background-color: wheat;
}
caLineEdit {
border-radius: 1px;
background: lightyellow;
color: black;
}
caTextEntry {
color: rgb(127, 0, 63);
background-color: cornsilk;
selection-color: #0a214c;
selection-background-color: wheat;
border: 1px groove black;
border-radius: 1px;
padding: 1px;
}
caTextEntry:focus {
padding: 0px;
border: 2px groove darkred;
border-radius: 1px;
}
QPushButton {
border-color: #00b;
border-radius: 2px;
padding: 3px;
border-width: 1px;
background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,
stop:0 rgba(224, 239, 255, 255),
stop:0.5 rgba(199, 215, 230, 255),
stop:1 rgba(184, 214, 236, 255));
}
QPushButton:hover {
background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,
stop:0 rgba(201, 226, 255, 255),
stop:0.5 rgba(177, 204, 230, 255),
stop:1 rgba(163, 205, 236, 255));
}
QPushButton:pressed {
background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,
stop:0 rgba(174, 219, 255, 255),
stop:0.5 rgba(165, 199, 230, 255),
stop:1 rgba(134, 188, 236, 255));
}
QPushButton:disabled {
background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1,
stop:0 rgba(174, 219, 255, 255),
stop:0.5 rgba(165, 199, 230, 255),
stop:1 rgba(134, 188, 236, 255));
}
caChoice {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
}
caSlider::groove:horizontal {
border: 1px solid #bbb;
background: lightgrey;
height: 20px;
border-radius: 4px;
}
caSlider::handle:horizontal {
background: red;
border: 1px solid #777;
width: 13px;
margin-top: -2px;
margin-bottom: -2px;
border-radius: 2px;
}
681
6
235
28
QFrame::NoFrame
COMET bis AMA1
Qt::AlignAbsolute|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
10
0
184
10
0
184
10
0
184
393
137
134
25
QFrame::NoFrame
MMAP5X/6Y
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
0
0
0
0
0
0
0
0
0
572
137
134
25
QFrame::NoFrame
MMAP7X/8Y
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
0
0
0
0
0
0
0
0
0
10
10
220
20
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
XPROSCAN:TIME:2
0
0
0
200
200
200
caLineEdit::Static
caLineEdit::Channel
caLineEdit::Channel
1.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
caLineEdit::decimal
1024
139
149
25
QFrame::NoFrame
MMAP9X/10Y
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
0
0
0
0
0
0
0
0
0
295
129
90
28
Wires
0
0
0
187
193
135
Wires
mmap_wires.adl
caRowColMenu::Menu
183
137
134
25
QFrame::NoFrame
MMAP3X/4Y
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
0
0
0
0
0
0
0
0
0
1372
138
164
25
QFrame::NoFrame
MMAP11X/12Y
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
0
0
0
0
0
0
0
0
0
1
816
120
28
previous
0
0
0
187
193
135
previous
comet.adl
caRowColMenu::Menu
9
137
134
25
QFrame::NoFrame
MMAP1X/2Y
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
0
0
0
0
0
0
0
0
0
687
43
15
15
A<0.9*1000
yesno.gif
MMAV5:IST:2
475
43
60
20
QFrame::NoFrame
MMAC1
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
0
0
0
0
0
0
0
0
0
687
65
15
15
A<0.9*300
yesno.gif
MMAV1:IST:2
475
65
60
20
QFrame::NoFrame
MMAC2
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
0
0
0
0
0
0
0
0
0
687
87
15
15
A<0.9*1000
yesno.gif
MMAV6:IST:2
475
87
60
20
QFrame::NoFrame
MMAC3
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
0
0
0
0
0
0
0
0
0
687
109
15
15
A<0.9*300
yesno.gif
MMAV2:IST:2
475
109
60
20
QFrame::NoFrame
MMAC4
Qt::AlignAbsolute|Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
ESimpleLabel::WidthAndHeight
0
0
0
0
0
0
0
0
0
510
141
15
15
A<0.9*1000
yesno.gif
MMAV6:IST:2
688
141
15
15
A<0.9*300
yesno.gif
MMAV2:IST:2
851
350
150
150
78
165
249
caGraphics::Solid
caGraphics::Filled
78
165
249
caGraphics::Rectangle
871
356
120
28
Degrader
0
0
0
187
193
135
Degrader
degrader.adl
caRowColMenu::Menu
859
395
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
941
397
50
20
Qt::AlignAbsolute|Qt::AlignCenter|Qt::AlignHCenter|Qt::AlignVCenter
DMAD1:IST:2.EGU
0
0
0
218
218
218
caLineEdit::Static
caLineEdit::Channel
caLineEdit::Channel
1.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
caLineEdit::string
861
397
80
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
DMAD1:IST:2
0
0
0
218
218
218
caLineEdit::Static
1
caLineEdit::User
caLineEdit::Channel
1.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
caLineEdit::decimal
883
424
100
70
true
3
1
true
DMAD1:SOL:1
caNumeric::User
true
caNumeric::User
238.000000000000000
70.000000000000000
0
605
255
100
A=SMA1Y
object_steerer.adl
0
708
255
100
A=SMA1X
object_steerer.adl
269
606
255
100
A=QMA1
object_quad.adl
269
708
255
100
A=QMA2
object_quad.adl
552
733
255
100
A=QMA3
object_quad.adl
860
605
255
100
A=SMA2Y
object_steerer.adl
860
708
255
100
A=SMA2X
object_steerer.adl
1171
606
255
100
A=QMA4
object_quad.adl
1171
708
255
100
A=QMA5
object_quad.adl
5
49
225
75
A=MMAP1-P,SPADEV=MMAV5,SPAVAL=1000
object_harp_control.adl
235
49
225
75
A=MMAP3-P,SPADEV=MMAV1,SPAVAL=300
object_harp_control.adl
997
49
225
75
A=MMAP9-P,SPADEV=MMAV3,SPAVAL=600
object_harp_control.adl
1311
49
225
75
A=MMAP11-P,SPADEV=MMAV3,SPAVAL=600
object_harp_control.adl
737
49
227
92
A=BMA1,B=KMAVD,SPADEV=MMAV8,SPAVAL=300
object_beamstop.adl
7
160
166
218
A=MMAP2Y,B=MMAP1-P
object_harp.adl
7
381
166
218
A=MMAP1X,B=MMAP1-P
object_harp.adl
185
160
166
218
A=MMAP4Y,B=MMAP3-P
object_harp.adl
caInclude::IfNotZero
MMAC3:STR:2
185
381
166
218
A=MMAP3X,B=MMAP3-P
object_harp.adl
1021
160
166
218
A=MMAP10Y,B=MMAP9-P
object_harp.adl
1020
380
166
218
A=MMAP9X,B=MMAP9-P
object_harp.adl
1372
160
166
218
A=MMAP12Y,B=MMAP11-P
object_harp.adl
1372
381
166
218
A=MMAP11X,B=MMAP11-P
object_harp.adl
369
160
166
218
A=MMAP6Y,B=MMAP5-P
object_harp_nostatus.adl
369
381
166
218
A=MMAP5X,B=MMAP5-P
object_harp_nostatus.adl
547
160
166
218
A=MMAP8Y,B=MMAP7-P
object_harp_nostatus.adl
547
381
166
218
A=MMAP7X,B=MMAP7-P
object_harp_nostatus.adl
552
606
255
125
A=AMAKI1
object_bend.adl
720
228
133
317
A=BMA1I
object_beamcur.adl
549
40
135
25
0
0
135
25
0
0
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
130
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
MMAC1:STR:2
0
0
0
218
218
218
caLineEdit::Static
1
caLineEdit::User
caLineEdit::Channel
1.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
549
63
135
25
0
0
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
130
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
MMAC2:STR:2
0
0
0
218
218
218
caLineEdit::Static
1
caLineEdit::User
caLineEdit::Channel
1.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
549
86
135
25
0
0
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
130
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
MMAC3:STR:2
0
0
0
218
218
218
caLineEdit::Static
1
caLineEdit::User
caLineEdit::Channel
1.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
549
109
135
25
0
0
133
23
160
18
7
caGraphics::Solid
1
160
18
7
caGraphics::Rectangle
160
18
7
2
2
130
20
Qt::AlignAbsolute|Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
MMAC4:STR:2
0
0
0
218
218
218
caLineEdit::Static
1
caLineEdit::User
caLineEdit::Channel
1.000000000000000
0.000000000000000
caLineEdit::WidthAndHeight
true
caLineEdit::decimal
1197
162
165
180
A=KMA5
object_kolstapel.adl
839
162
165
180
A=KMA3
object_kolstapel.adl
722
576
190
26
AMAKI Hall Speed
0
0
0
187
193
135
AMAKIHallSpeed
AMAKI_Hall_Speed.adl
caRowColMenu::Menu
1428
785
122
62
0
0
120
28
bis_ama2
0
0
0
187
193
135
bis_ama2
bis_ama2.adl
caRowColMenu::Menu
0
32
120
28
bis_ame2
0
0
0
187
193
135
bis_ame2
bis_ame2.adl
caRowColMenu::Menu
caLabel_0
caLabel_1
caLabel_2
caLabel_3
caLabel_4
caLabel_5
caLabel_6
caImage_0
caLabel_7
caImage_1
caLabel_8
caImage_2
caLabel_9
caImage_3
caLabel_10
caImage_4
caImage_5
caRectangle_0
caRectangle_1
caInclude_0
caInclude_1
caInclude_2
caInclude_3
caInclude_4
caInclude_5
caInclude_6
caInclude_7
caInclude_8
caInclude_9
caInclude_10
caInclude_11
caInclude_12
caInclude_13
caInclude_14
caInclude_15
caInclude_16
caInclude_17
caInclude_18
caInclude_19
caInclude_20
caInclude_21
caInclude_22
caInclude_23
caInclude_24
caInclude_25
caInclude_26
caInclude_27
caFrame_28
caFrame_30
caFrame_31
caFrame_32
caInclude_33
caInclude_34
caFrame_35
caLineEdit_0
caRelatedDisplay_0
caRelatedDisplay_1
caRelatedDisplay_2
caLineEdit_1
caLineEdit_2
caNumeric_0
caRelatedDisplay_3
caNumeric
QFrame
caRelatedDisplay
QWidget
caFrame
QFrame
1
caLabel
QLabel
caGraphics
QWidget
caImage
QWidget
caInclude
QWidget
caLineEdit
QLineEdit
caQtDM_Viewer/qtdesigner.bat 0000644 0002101 0021616 00000000463 12315302333 015211 0 ustar mezger sls echo on
echo Setting up environment for Qt usage...
set QTDIR=C:\QtSDK\Desktop\Qt\4.8.1\mingw
set PATH=%QTDIR%\bin;%PATH%
set PATH=C:\QtSDK\mingw\bin;%PATH%
set PATH=C:\work\QtControls\qtcontrols\release;%PATH%
set PATH=C:\Qwt-6.0.1\lib;%PATH%
cd \work\caQtDM\parser\proscanFiles
start designer caQtDM_Viewer/src/ 0000755 0002101 0021616 00000000000 12401341006 013134 5 ustar mezger sls caQtDM_Viewer/src/Info.plist 0000644 0002101 0021616 00000001514 12356464576 015140 0 ustar mezger sls
NSPrincipalClass
NSApplication
CFBundleIconFile
caQtDM.icns
CFBundlePackageType
APPL
CFBundleGetInfoString
Created by Qt/QMake
CFBundleSignature
APPL
CFBundleExecutable
caQtDM
CFBundleIdentifier
ch.psi.caQtDM
CFBundleVersion
3.8.0
NSSupportsSuddenTermination
CFBundleInfoDictionaryVersion
6.0
NOTE
This file was generated by Qt/QMake.
caQtDM_Viewer/src/caQtDM.h 0000644 0002101 0021616 00000000110 12315302333 014412 0 ustar mezger sls #ifndef CAQTDM_H
#define CAQTDM_H
QApplication app;
#endif // CAQTDM_H
caQtDM_Viewer/src/caQtDM.icns 0000644 0002101 0021616 00000513722 12315302333 015141 0 ustar mezger sls icns —ÒTOC His32 s8mk il32 l8mk it32 Š›t8mk @ic08 Î3ic09 ëis32 ÿÿþþý‚ÿûûùøûÿüÿßlŠ™ªÃÙêÿýÿöÿbeJWYVoPƒ—ëÿùÿLQ?1,0J#½ÿøÿL
Uœ§GS(cHŸÿøÿI)LcÿYmÕ)Ê}0ÉÿøÿH.§Àsð¥ÿÏu×ÿùÿI ¢êÿlôwÙt]ÒÿùÿI®Õ¼pþ„îj×ÿøÿI+C‘¯.OÊZ¶aSYÌÿøÿJ3YKçp‹5¿Œ7ÇÿøÿLFˆ^¯ÿ|24‰Ð´ÂÿøÿM?st=¶f 8RåüÁÿøÿIIophM!9f›´Íÿ÷ÿ_5tex‰ºÑáêúýÿýÿê®Ïâöýƒÿûÿÿþÿûùýý€ÿ÷ûúùûÿýÿê£ÊÓÚãñôÿþÿÿýÿ÷ÿ‚N¤‰”¥™·w²»¬îÿøÿX#€/UOML‡@Éÿ÷ÿV†$ž©MZ]…hÿùÿoW‡yÿŸ†Ù:Ç›_×ÿùÿd