/*----------------------------------------------------------------------------
* SciPlot A generalized plotting widget
*
* Copyright (c) 1996 Robert W. McMullen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*
* Author: Rob McMullen <rwmcm@mail.ae.utexas.edu>
* http://www.ae.utexas.edu/~rwmcm
*
* Modifications (KUK): Double-buffering, seperate Text color
*/
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <stdio.h>
#include <stdlib.h>
#include "SciPlotP.h"
#define offset(field) XtOffsetOf(SciPlotRec, plot.field)
static XtResource resources[] =
{
{XtNchartType, XtCMargin, XtRInt, sizeof(int),
offset(ChartType), XtRImmediate, (XtPointer) XtCARTESIAN},
{XtNdegrees, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(Degrees), XtRImmediate, (XtPointer) True},
{XtNdrawMajor, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(DrawMajor), XtRImmediate, (XtPointer) True},
{XtNdrawMajorTics, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(DrawMajorTics), XtRImmediate, (XtPointer) True},
{XtNdrawMinor, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(DrawMinor), XtRImmediate, (XtPointer) True},
{XtNdrawMinorTics, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(DrawMinorTics), XtRImmediate, (XtPointer) True},
{XtNmonochrome, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(Monochrome), XtRImmediate, (XtPointer) False},
{XtNshowLegend, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(ShowLegend), XtRImmediate, (XtPointer) True},
{XtNshowTitle, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(ShowTitle), XtRImmediate, (XtPointer) True},
{XtNshowXLabel, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(ShowXLabel), XtRImmediate, (XtPointer) True},
{XtNshowYLabel, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(ShowYLabel), XtRImmediate, (XtPointer) True},
{XtNxLabel, XtCString, XtRString, sizeof(String),
offset(TransientXLabel), XtRString, "X Axis"},
{XtNyLabel, XtCString, XtRString, sizeof(String),
offset(TransientYLabel), XtRString, "Y Axis"},
{XtNplotTitle, XtCString, XtRString, sizeof(String),
offset(TransientPlotTitle), XtRString, "Plot"},
{XtNmargin, XtCMargin, XtRInt, sizeof(int),
offset(Margin), XtRImmediate, (XtPointer) 5},
{XtNtitleMargin, XtCMargin, XtRInt, sizeof(int),
offset(TitleMargin), XtRImmediate, (XtPointer) 16},
{XtNlegendLineSize, XtCMargin, XtRInt, sizeof(int),
offset(LegendLineSize), XtRImmediate, (XtPointer) 16},
{XtNdefaultMarkerSize, XtCMargin, XtRInt, sizeof(int),
offset(DefaultMarkerSize), XtRImmediate, (XtPointer) 3},
{XtNlegendMargin, XtCMargin, XtRInt, sizeof(int),
offset(LegendMargin), XtRImmediate, (XtPointer) 3},
{XtNlegendThroughPlot, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(LegendThroughPlot), XtRImmediate, (XtPointer) False},
{XtNtitleFont, XtCMargin, XtRInt, sizeof(int),
offset(TitleFont), XtRImmediate, (XtPointer) (XtFONT_HELVETICA | 24)},
{XtNlabelFont, XtCMargin, XtRInt, sizeof(int),
offset(LabelFont), XtRImmediate, (XtPointer) (XtFONT_TIMES | 18)},
{XtNaxisFont, XtCMargin, XtRInt, sizeof(int),
offset(AxisFont), XtRImmediate, (XtPointer) (XtFONT_TIMES | 10)},
{XtNxAutoScale, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(XAutoScale), XtRImmediate, (XtPointer) True},
{XtNyAutoScale, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(YAutoScale), XtRImmediate, (XtPointer) True},
{XtNxAxisNumbers, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(XAxisNumbers), XtRImmediate, (XtPointer) True},
{XtNyAxisNumbers, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(YAxisNumbers), XtRImmediate, (XtPointer) True},
{XtNxLog, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(XLog), XtRImmediate, (XtPointer) False},
{XtNyLog, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(YLog), XtRImmediate, (XtPointer) False},
{XtNxOrigin, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(XOrigin), XtRImmediate, (XtPointer) False},
{XtNyOrigin, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(YOrigin), XtRImmediate, (XtPointer) False},
{XtNyNumbersHorizontal, XtCBoolean, XtRBoolean, sizeof(Boolean),
offset(YNumHorz), XtRImmediate, (XtPointer) True},
};
static SciPlotFontDesc font_desc_table[] =
{
{XtFONT_TIMES, "Times", "times", False, True},
{XtFONT_COURIER, "Courier", "courier", True, False},
{XtFONT_HELVETICA, "Helvetica", "helvetica", True, False},
{XtFONT_LUCIDA, "Lucida", "lucidabright", False, False},
{XtFONT_LUCIDASANS, "LucidaSans", "lucida", False, False},
{XtFONT_NCSCHOOLBOOK, "NewCenturySchlbk",
"new century schoolbook", False, True},
{-1, NULL, NULL, False, False},
};
/*
* Private function declarations
*/
static void Redisplay();
static void Resize();
static Boolean SetValues();
static void GetValuesHook();
static void Initialize();
static void Realize();
static void Destroy();
static void ComputeAll();
static void ComputeAllDimensions();
static void DrawAll();
static void ItemDrawAll();
static void ItemDraw();
static void EraseAll();
static void FontInit();
static int ColorStore(SciPlotWidget w, Pixel color);
static int FontStore();
static int FontnumReplace();
SciPlotClassRec sciplotClassRec =
{
{
/* core_class fields */
#ifdef MOTIF
/* superclass */ (WidgetClass) & xmPrimitiveClassRec,
#else
/* superclass */ (WidgetClass) & widgetClassRec,
#endif
/* class_name */ "SciPlot",
/* widget_size */ sizeof(SciPlotRec),
/* class_initialize */ NULL,
/* class_part_initialize */ NULL,
/* class_inited */ False,
/* initialize */ Initialize,
/* initialize_hook */ NULL,
/* realize */ Realize,
/* actions */ NULL,
/* num_actions */ 0,
/* resources */ resources,
/* num_resources */ XtNumber(resources),
/* xrm_class */ NULLQUARK,
/* compress_motion */ True,
/* compress_exposure */ XtExposeCompressMultiple,
/* compress_enterleave */ True,
/* visible_interest */ True,
/* destroy */ Destroy,
/* resize */ Resize,
/* expose */ Redisplay,
/* set_values */ SetValues,
/* set_values_hook */ NULL,
/* set_values_almost */ XtInheritSetValuesAlmost,
/* get_values_hook */ GetValuesHook,
/* accept_focus */ NULL,
/* version */ XtVersion,
/* callback_private */ NULL,
/* tm_table */ NULL,
/* query_geometry */ NULL,
/* display_accelerator */ XtInheritDisplayAccelerator,
/* extension */ NULL
},
#ifdef MOTIF
{
/* primitive_class fields */
/* border_highlight */ (XtWidgetProc) _XtInherit,
/* border_unhighligh */ (XtWidgetProc) _XtInherit,
/* tran
edm Extensible Display Manager
需积分: 0 86 浏览量
更新于2022-03-22
收藏 3.18MB ZIP 举报
EDM(Extensible Display Manager)是一种专为EPICS(Experimental Physics and Industrial Control System)环境设计的可扩展显示窗口管理器。在众多EPICS站点中,EDM被广泛应用于创建和展示实时监控界面,以实现对实验设备或工业控制系统状态的可视化操作。作为一个基于X11/Linux系统的软件,EDM充分利用了这两种技术的优势,提供了高效、稳定和用户友好的界面。
让我们深入了解一下EDM的主要功能。它的核心是提供了一个编辑器和运行时环境。编辑器允许用户设计和配置监控页面,这些页面可以包含各种图形元素,如文本框、图表、按钮等,用于显示和控制系统的参数。用户通过直观的界面,可以定义每个元素的属性,例如数据源、更新频率、显示格式等,从而创建出符合实际需求的监控界面。
在设计阶段,用户可以通过EDM编辑器拖放控件,调整布局,设置颜色、字体等样式,以及连接到EPICS数据库中的变量。这极大地简化了界面设计的过程,使得非程序员也能轻松构建监控界面。编辑完成后,保存的页面配置文件可以被EDM运行时环境读取并执行,动态地显示实时数据。
运行时环境是EDM的另一个关键组成部分。它负责加载并执行由编辑器创建的页面,实时刷新数据显示,并处理用户的交互操作。这种分离的设计模式使得开发和运行可以独立进行,提高了工作效率。此外,由于EDM基于X11,它可以很好地适应Linux环境,支持多窗口系统,使得用户可以在同一时间内查看和控制多个设备或系统的状态。
在运维方面,EDM的可扩展性体现在其能够与EPICS的其他组件无缝集成。例如,它可以与CA(Channel Access)协议配合,透明地访问EPICS的IOCs(Input/Output Controllers)数据。同时,由于其开源特性,用户可以根据自身需求对其进行定制和扩展,增加新的功能或优化性能。
EDM是一个强大的工具,尤其适用于科学实验和工业自动化领域的监控系统。它的编辑器和运行时环境提供了灵活的界面设计和实时数据展示,而其在Linux环境下的运行则确保了稳定性和效率。通过熟练掌握EDM,运维人员能够更有效地管理和监控复杂的系统,提高工作质量和效率。对于想要深入了解EPICS系统或提升运维技能的人来说,学习和使用EDM是不可或缺的一部分。
EPICSTechnical
- 粉丝: 1049
- 资源: 15
最新资源
- RK3588 demo板原理图
- html+css 圣诞树代码html
- GaAs限幅器芯片:LCLM0002P1,工作频段DC-3Ghz
- 仓库管理系统:用户界面与交互体验
- NSFileReadError如何解决.md
- NSFileWriteError如何解决.md
- StopAsyncIteration.md
- ScopedSlotError解决办法.md
- StackOverflowError(解决方案).md
- AsyncComponentError解决办法.md
- StringIndexOutOfBoundsException(解决方案).md
- NSURLConnectionError如何解决.md
- LifecycleHookError解决办法.md
- MissingResourceException(解决方案).md
- NSURLError如何解决.md
- IndentationError.md