You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
612 lines
14 KiB
612 lines
14 KiB
15 years ago
|
/*
|
||
|
KSysGuard, the KDE System Guard
|
||
|
|
||
|
Copyright (c) 1999 - 2002 Chris Schlaeger <cs@kde.org>
|
||
|
|
||
|
This program is free software; you can redistribute it and/or
|
||
|
modify it under the terms of version 2 of the GNU General Public
|
||
|
License as published by the Free Software Foundation.
|
||
|
|
||
|
This program is distributed in the hope that it will be useful,
|
||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
GNU General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU General Public License
|
||
|
along with this program; if not, write to the Free Software
|
||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
|
||
|
KSysGuard is currently maintained by Chris Schlaeger <cs@kde.org>.
|
||
|
Please do not commit any changes without consulting me first. Thanks!
|
||
|
|
||
|
*/
|
||
|
|
||
14 years ago
|
#include <tqcheckbox.h>
|
||
|
#include <tqdom.h>
|
||
|
#include <tqpopupmenu.h>
|
||
|
#include <tqspinbox.h>
|
||
|
#include <tqwhatsthis.h>
|
||
|
#include <tqbitmap.h>
|
||
15 years ago
|
|
||
12 years ago
|
#include <tdeapplication.h>
|
||
15 years ago
|
#include <kdebug.h>
|
||
|
#include <kiconloader.h>
|
||
12 years ago
|
#include <tdelocale.h>
|
||
|
#include <tdemessagebox.h>
|
||
15 years ago
|
#include <krun.h>
|
||
|
#include <kservice.h>
|
||
|
|
||
|
#include "SensorManager.h"
|
||
|
#include "TimerSettings.h"
|
||
|
|
||
|
#include "SensorDisplay.h"
|
||
|
|
||
|
using namespace KSGRD;
|
||
|
|
||
14 years ago
|
SensorDisplay::SensorDisplay( TQWidget *parent, const char *name,
|
||
|
const TQString &title, bool nf, bool isApplet)
|
||
|
: TQWidget( parent, name )
|
||
15 years ago
|
{
|
||
|
mIsApplet = isApplet;
|
||
|
mSensors.setAutoDelete( true );
|
||
|
|
||
|
// default interval is 2 seconds.
|
||
|
mUpdateInterval = 2;
|
||
|
mUseGlobalUpdateInterval = true;
|
||
|
mModified = false;
|
||
|
mShowUnit = false;
|
||
|
mTimerId = NONE;
|
||
|
mFrame = 0;
|
||
|
mErrorIndicator = 0;
|
||
|
mPlotterWdg = 0;
|
||
|
|
||
|
setTimerOn( true );
|
||
14 years ago
|
TQWhatsThis::add( this, "dummy" );
|
||
15 years ago
|
|
||
|
if(!nf) {
|
||
14 years ago
|
mFrame = new TQGroupBox( 2, Qt::Vertical, "", this, "displayFrame");
|
||
15 years ago
|
mFrame->setFlat(true);
|
||
13 years ago
|
mFrame->setAlignment(Qt::AlignHCenter);
|
||
15 years ago
|
mFrame->setInsideMargin(2);
|
||
|
|
||
|
setTitle( title );
|
||
|
/* All RMB clicks to the box frame will be handled by
|
||
|
* SensorDisplay::eventFilter. */
|
||
|
mFrame->installEventFilter( this );
|
||
|
}
|
||
|
|
||
|
|
||
|
setMinimumSize( 16, 16 );
|
||
|
setModified( false );
|
||
|
setSensorOk( false );
|
||
|
|
||
|
/* Let's call updateWhatsThis() in case the derived class does not do
|
||
|
* this. */
|
||
|
updateWhatsThis();
|
||
|
}
|
||
|
|
||
|
SensorDisplay::~SensorDisplay()
|
||
|
{
|
||
|
if ( SensorMgr != 0 )
|
||
|
SensorMgr->disconnectClient( this );
|
||
|
|
||
|
killTimer( mTimerId );
|
||
|
}
|
||
|
|
||
|
void SensorDisplay::registerSensor( SensorProperties *sp )
|
||
|
{
|
||
|
/* Make sure that we have a connection established to the specified
|
||
|
* host. When a work sheet has been saved while it had dangling
|
||
|
* sensors, the connect info is not saved in the work sheet. In such
|
||
|
* a case the user can re-enter the connect information and the
|
||
|
* connection will be established. */
|
||
|
if ( !SensorMgr->engageHost( sp->hostName() ) ) {
|
||
14 years ago
|
TQString msg = i18n( "It is impossible to connect to \'%1\'." ).arg( sp->hostName() );
|
||
15 years ago
|
KMessageBox::error( this, msg );
|
||
|
}
|
||
|
|
||
|
mSensors.append( sp );
|
||
|
}
|
||
|
|
||
|
void SensorDisplay::unregisterSensor( uint pos )
|
||
|
{
|
||
|
mSensors.remove( pos );
|
||
|
}
|
||
|
|
||
|
void SensorDisplay::configureUpdateInterval()
|
||
|
{
|
||
|
TimerSettings dlg( this );
|
||
|
|
||
|
dlg.setUseGlobalUpdate( mUseGlobalUpdateInterval );
|
||
|
dlg.setInterval( mUpdateInterval );
|
||
|
|
||
|
if ( dlg.exec() ) {
|
||
|
if ( dlg.useGlobalUpdate() ) {
|
||
|
mUseGlobalUpdateInterval = true;
|
||
|
|
||
14 years ago
|
SensorBoard* sb = dynamic_cast<SensorBoard*>( parentWidget() );
|
||
15 years ago
|
if ( !sb ) {
|
||
|
kdDebug(1215) << "dynamic cast lacks" << endl;
|
||
|
setUpdateInterval( 2 );
|
||
|
} else {
|
||
|
setUpdateInterval( sb->updateInterval() );
|
||
|
}
|
||
|
} else {
|
||
|
mUseGlobalUpdateInterval = false;
|
||
|
setUpdateInterval( dlg.interval() );
|
||
|
}
|
||
|
|
||
|
setModified( true );
|
||
|
}
|
||
|
}
|
||
|
|
||
14 years ago
|
void SensorDisplay::timerEvent( TQTimerEvent* )
|
||
15 years ago
|
{
|
||
|
int i = 0;
|
||
|
for ( SensorProperties *s = mSensors.first(); s; s = mSensors.next(), ++i )
|
||
|
sendRequest( s->hostName(), s->name(), i );
|
||
|
}
|
||
|
|
||
14 years ago
|
void SensorDisplay::resizeEvent( TQResizeEvent* )
|
||
15 years ago
|
{
|
||
|
if(mFrame)
|
||
|
mFrame->setGeometry( rect() );
|
||
|
}
|
||
|
|
||
14 years ago
|
bool SensorDisplay::eventFilter( TQObject *object, TQEvent *event )
|
||
15 years ago
|
{
|
||
14 years ago
|
if ( event->type() == TQEvent::MouseButtonPress &&
|
||
14 years ago
|
( (TQMouseEvent*)event)->button() == Qt::RightButton ) {
|
||
14 years ago
|
TQPopupMenu pm;
|
||
15 years ago
|
if ( mIsApplet ) {
|
||
|
pm.insertItem( i18n( "Launch &System Guard"), 1 );
|
||
|
pm.insertSeparator();
|
||
|
}
|
||
|
if ( hasSettingsDialog() )
|
||
|
pm.insertItem( i18n( "&Properties" ), 2 );
|
||
|
pm.insertItem( i18n( "&Remove Display" ), 3 );
|
||
|
pm.insertSeparator();
|
||
|
pm.insertItem( i18n( "&Setup Update Interval..." ), 4 );
|
||
|
if ( !timerOn() )
|
||
|
pm.insertItem( i18n( "&Continue Update" ), 5 );
|
||
|
else
|
||
|
pm.insertItem( i18n( "P&ause Update" ), 6 );
|
||
|
|
||
14 years ago
|
switch ( pm.exec( TQCursor::pos() ) ) {
|
||
15 years ago
|
case 1:
|
||
|
KRun::run(*KService::serviceByDesktopName("ksysguard"), KURL::List());
|
||
|
break;
|
||
|
case 2:
|
||
|
configureSettings();
|
||
|
break;
|
||
|
case 3: {
|
||
14 years ago
|
TQCustomEvent *e = new TQCustomEvent( TQEvent::User );
|
||
15 years ago
|
e->setData( this );
|
||
|
kapp->postEvent( parent(), e );
|
||
|
}
|
||
|
break;
|
||
|
case 4:
|
||
|
configureUpdateInterval();
|
||
|
break;
|
||
|
case 5:
|
||
|
setTimerOn( true );
|
||
|
setModified( true );
|
||
|
break;
|
||
|
case 6:
|
||
|
setTimerOn( false );
|
||
|
setModified( true );
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
return true;
|
||
14 years ago
|
} else if ( event->type() == TQEvent::MouseButtonRelease &&
|
||
14 years ago
|
( ( TQMouseEvent*)event)->button() == Qt::LeftButton ) {
|
||
15 years ago
|
setFocus();
|
||
|
}
|
||
|
|
||
14 years ago
|
return TQWidget::eventFilter( object, event );
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void SensorDisplay::sendRequest( const TQString &hostName,
|
||
|
const TQString &command, int id )
|
||
15 years ago
|
{
|
||
|
if ( !SensorMgr->sendRequest( hostName, command, (SensorClient*)this, id ) )
|
||
|
sensorError( id, true );
|
||
|
}
|
||
|
|
||
|
void SensorDisplay::sensorError( int sensorId, bool err )
|
||
|
{
|
||
|
if ( sensorId >= (int)mSensors.count() || sensorId < 0 )
|
||
|
return;
|
||
|
|
||
13 years ago
|
if ( err == mSensors.at( sensorId )->isOk() ) {
|
||
15 years ago
|
// this happens only when the sensorOk status needs to be changed.
|
||
13 years ago
|
mSensors.at( sensorId )->setIsOk( !err );
|
||
15 years ago
|
}
|
||
|
|
||
|
bool ok = true;
|
||
|
for ( uint i = 0; i < mSensors.count(); ++i )
|
||
13 years ago
|
if ( !mSensors.at( i )->isOk() ) {
|
||
15 years ago
|
ok = false;
|
||
|
break;
|
||
|
}
|
||
|
|
||
|
setSensorOk( ok );
|
||
|
}
|
||
|
|
||
|
void SensorDisplay::updateWhatsThis()
|
||
|
{
|
||
14 years ago
|
TQWhatsThis::add( this, i18n(
|
||
15 years ago
|
"<qt><p>This is a sensor display. To customize a sensor display click "
|
||
|
"and hold the right mouse button on either the frame or the "
|
||
|
"display box and select the <i>Properties</i> entry from the popup "
|
||
|
"menu. Select <i>Remove</i> to delete the display from the worksheet."
|
||
|
"</p>%1</qt>" ).arg( additionalWhatsThis() ) );
|
||
|
}
|
||
|
|
||
14 years ago
|
void SensorDisplay::hosts( TQStringList& list )
|
||
15 years ago
|
{
|
||
|
for ( SensorProperties *s = mSensors.first(); s; s = mSensors.next() )
|
||
13 years ago
|
if ( !list.contains( s->hostName() ) )
|
||
15 years ago
|
list.append( s->hostName() );
|
||
|
}
|
||
|
|
||
14 years ago
|
TQColor SensorDisplay::restoreColor( TQDomElement &element, const TQString &attr,
|
||
|
const TQColor& fallback )
|
||
15 years ago
|
{
|
||
|
bool ok;
|
||
|
uint c = element.attribute( attr ).toUInt( &ok );
|
||
|
if ( !ok )
|
||
|
return fallback;
|
||
|
else
|
||
14 years ago
|
return TQColor( (c >> 16) & 0xFF, (c >> 8) & 0xFF, c & 0xFF );
|
||
15 years ago
|
}
|
||
|
|
||
14 years ago
|
void SensorDisplay::saveColor( TQDomElement &element, const TQString &attr,
|
||
|
const TQColor &color )
|
||
15 years ago
|
{
|
||
|
int r, g, b;
|
||
|
color.rgb( &r, &g, &b );
|
||
|
element.setAttribute( attr, (r << 16) | (g << 8) | b );
|
||
|
}
|
||
|
|
||
14 years ago
|
bool SensorDisplay::addSensor( const TQString &hostName, const TQString &name,
|
||
|
const TQString &type, const TQString &description )
|
||
15 years ago
|
{
|
||
|
registerSensor( new SensorProperties( hostName, name, type, description ) );
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
bool SensorDisplay::removeSensor( uint pos )
|
||
|
{
|
||
|
unregisterSensor( pos );
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
void SensorDisplay::setUpdateInterval( uint interval )
|
||
|
{
|
||
|
bool timerActive = timerOn();
|
||
|
|
||
|
if ( timerActive )
|
||
|
setTimerOn( false );
|
||
|
|
||
|
mUpdateInterval = interval;
|
||
|
|
||
|
if ( timerActive )
|
||
|
setTimerOn( true );
|
||
|
}
|
||
|
|
||
|
bool SensorDisplay::hasSettingsDialog() const
|
||
|
{
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
void SensorDisplay::configureSettings()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
void SensorDisplay::setUseGlobalUpdateInterval( bool value )
|
||
|
{
|
||
|
mUseGlobalUpdateInterval = value;
|
||
|
}
|
||
|
|
||
|
bool SensorDisplay::useGlobalUpdateInterval() const
|
||
|
{
|
||
|
return mUseGlobalUpdateInterval;
|
||
|
}
|
||
|
|
||
14 years ago
|
TQString SensorDisplay::additionalWhatsThis()
|
||
15 years ago
|
{
|
||
14 years ago
|
return TQString::null;
|
||
15 years ago
|
}
|
||
|
|
||
|
void SensorDisplay::sensorLost( int reqId )
|
||
|
{
|
||
|
sensorError( reqId, true );
|
||
|
}
|
||
|
|
||
14 years ago
|
bool SensorDisplay::restoreSettings( TQDomElement &element )
|
||
15 years ago
|
{
|
||
14 years ago
|
TQString str = element.attribute( "showUnit", "X" );
|
||
15 years ago
|
if(!str.isEmpty() && str != "X") {
|
||
|
mShowUnit = str.toInt();
|
||
|
}
|
||
14 years ago
|
str = element.attribute( "unit", TQString::null );
|
||
15 years ago
|
if(!str.isEmpty())
|
||
|
setUnit(str);
|
||
14 years ago
|
str = element.attribute( "title", TQString::null );
|
||
15 years ago
|
if(!str.isEmpty())
|
||
|
setTitle(str);
|
||
|
|
||
14 years ago
|
if ( element.attribute( "updateInterval" ) != TQString::null ) {
|
||
15 years ago
|
mUseGlobalUpdateInterval = false;
|
||
|
setUpdateInterval( element.attribute( "updateInterval", "2" ).toInt() );
|
||
|
} else {
|
||
|
mUseGlobalUpdateInterval = true;
|
||
|
|
||
14 years ago
|
SensorBoard* sb = dynamic_cast<SensorBoard*>( parentWidget() );
|
||
15 years ago
|
if ( !sb ) {
|
||
|
kdDebug(1215) << "dynamic cast lacks" << endl;
|
||
|
setUpdateInterval( 2 );
|
||
|
} else
|
||
|
setUpdateInterval( sb->updateInterval() );
|
||
|
}
|
||
|
|
||
|
if ( element.attribute( "pause", "0" ).toInt() == 0 )
|
||
|
setTimerOn( true );
|
||
|
else
|
||
|
setTimerOn( false );
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
|
||
14 years ago
|
bool SensorDisplay::saveSettings( TQDomDocument&, TQDomElement &element, bool )
|
||
15 years ago
|
{
|
||
|
element.setAttribute( "title", title() );
|
||
|
element.setAttribute( "unit", unit() );
|
||
|
element.setAttribute( "showUnit", mShowUnit );
|
||
|
|
||
|
if ( mUseGlobalUpdateInterval )
|
||
|
element.setAttribute( "globalUpdate", "1" );
|
||
|
else {
|
||
|
element.setAttribute( "globalUpdate", "0" );
|
||
|
element.setAttribute( "updateInterval", mUpdateInterval );
|
||
|
}
|
||
|
|
||
|
if ( !timerOn() )
|
||
|
element.setAttribute( "pause", 1 );
|
||
|
else
|
||
|
element.setAttribute( "pause", 0 );
|
||
|
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
void SensorDisplay::setTimerOn( bool on )
|
||
|
{
|
||
|
if ( on ) {
|
||
|
if ( mTimerId == NONE )
|
||
|
mTimerId = startTimer( mUpdateInterval * 1000 );
|
||
|
} else {
|
||
|
if ( mTimerId != NONE ) {
|
||
|
killTimer( mTimerId );
|
||
|
mTimerId = NONE;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
bool SensorDisplay::timerOn() const
|
||
|
{
|
||
|
return ( mTimerId != NONE );
|
||
|
}
|
||
|
|
||
|
bool SensorDisplay::modified() const
|
||
|
{
|
||
|
return mModified;
|
||
|
}
|
||
|
|
||
14 years ago
|
TQPtrList<SensorProperties> &SensorDisplay::sensors()
|
||
15 years ago
|
{
|
||
|
return mSensors;
|
||
|
}
|
||
|
|
||
|
void SensorDisplay::rmbPressed()
|
||
|
{
|
||
|
emit showPopupMenu( this );
|
||
|
}
|
||
|
|
||
|
void SensorDisplay::applySettings()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
void SensorDisplay::applyStyle()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
void SensorDisplay::setModified( bool value )
|
||
|
{
|
||
|
if ( value != mModified ) {
|
||
|
mModified = value;
|
||
|
emit modified( mModified );
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void SensorDisplay::setSensorOk( bool ok )
|
||
|
{
|
||
|
if ( ok ) {
|
||
|
delete mErrorIndicator;
|
||
|
mErrorIndicator = 0;
|
||
|
} else {
|
||
|
if ( mErrorIndicator )
|
||
|
return;
|
||
|
|
||
12 years ago
|
TQPixmap errorIcon = TDEGlobal::iconLoader()->loadIcon( "connect_creating", TDEIcon::Desktop,
|
||
|
TDEIcon::SizeSmall );
|
||
15 years ago
|
if ( !mPlotterWdg )
|
||
|
return;
|
||
|
|
||
14 years ago
|
mErrorIndicator = new TQWidget( mPlotterWdg );
|
||
15 years ago
|
mErrorIndicator->setErasePixmap( errorIcon );
|
||
|
mErrorIndicator->resize( errorIcon.size() );
|
||
13 years ago
|
if ( errorIcon.mask() )
|
||
|
mErrorIndicator->setMask( *errorIcon.mask() );
|
||
15 years ago
|
mErrorIndicator->move( 0, 0 );
|
||
|
mErrorIndicator->show();
|
||
|
}
|
||
|
}
|
||
|
|
||
14 years ago
|
void SensorDisplay::setTitle( const TQString &title )
|
||
15 years ago
|
{
|
||
|
mTitle = title;
|
||
|
|
||
|
if(!mFrame) {
|
||
|
return; //fixme. create a frame and move widget inside it.
|
||
|
}
|
||
|
|
||
|
/* Changing the frame title may increase the width of the frame and
|
||
14 years ago
|
* hence breaks the layout. To avoid this, we save the original size
|
||
15 years ago
|
* and restore it after we have set the frame title. */
|
||
14 years ago
|
TQSize s = mFrame->size();
|
||
15 years ago
|
|
||
|
if ( mShowUnit && !mUnit.isEmpty() )
|
||
|
mFrame->setTitle( mTitle + " [" + mUnit + "]" );
|
||
|
else
|
||
|
mFrame->setTitle( mTitle );
|
||
|
mFrame->setGeometry( 0, 0, s.width(), s.height() );
|
||
|
}
|
||
|
|
||
14 years ago
|
TQString SensorDisplay::title() const
|
||
15 years ago
|
{
|
||
|
return mTitle;
|
||
|
}
|
||
|
|
||
14 years ago
|
void SensorDisplay::setUnit( const TQString &unit )
|
||
15 years ago
|
{
|
||
|
mUnit = unit;
|
||
|
}
|
||
|
|
||
14 years ago
|
TQString SensorDisplay::unit() const
|
||
15 years ago
|
{
|
||
|
return mUnit;
|
||
|
}
|
||
|
|
||
|
void SensorDisplay::setShowUnit( bool value )
|
||
|
{
|
||
|
mShowUnit = value;
|
||
|
}
|
||
|
|
||
|
bool SensorDisplay::showUnit() const
|
||
|
{
|
||
|
return mShowUnit;
|
||
|
}
|
||
|
|
||
14 years ago
|
void SensorDisplay::setPlotterWidget( TQWidget *wdg )
|
||
15 years ago
|
{
|
||
|
mPlotterWdg = wdg;
|
||
|
|
||
|
}
|
||
|
|
||
14 years ago
|
TQWidget *SensorDisplay::frame()
|
||
15 years ago
|
{
|
||
|
return mFrame;
|
||
|
}
|
||
|
|
||
|
//void SensorDisplay::setNoFrame( bool /*value*/ )
|
||
|
//{
|
||
|
//FIXME - delete or create the frame as needed
|
||
|
//}
|
||
|
|
||
|
bool SensorDisplay::noFrame() const
|
||
|
{
|
||
|
return !mFrame;
|
||
|
}
|
||
|
|
||
14 years ago
|
void SensorDisplay::reorderSensors(const TQValueList<int> &orderOfSensors)
|
||
15 years ago
|
{
|
||
14 years ago
|
TQPtrList<SensorProperties> newSensors;
|
||
15 years ago
|
for ( uint i = 0; i < orderOfSensors.count(); ++i ) {
|
||
13 years ago
|
newSensors.append( mSensors.at(orderOfSensors[i] ));
|
||
15 years ago
|
}
|
||
|
|
||
|
mSensors.setAutoDelete( false );
|
||
|
mSensors = newSensors;
|
||
|
mSensors.setAutoDelete( true );
|
||
|
}
|
||
|
|
||
|
|
||
|
SensorProperties::SensorProperties()
|
||
|
{
|
||
|
}
|
||
|
|
||
14 years ago
|
SensorProperties::SensorProperties( const TQString &hostName, const TQString &name,
|
||
|
const TQString &type, const TQString &description )
|
||
15 years ago
|
: mHostName( hostName ), mName( name ), mType( type ), mDescription( description )
|
||
|
{
|
||
|
mOk = false;
|
||
|
}
|
||
|
|
||
|
SensorProperties::~SensorProperties()
|
||
|
{
|
||
|
}
|
||
|
|
||
14 years ago
|
void SensorProperties::setHostName( const TQString &hostName )
|
||
15 years ago
|
{
|
||
|
mHostName = hostName;
|
||
|
}
|
||
|
|
||
14 years ago
|
TQString SensorProperties::hostName() const
|
||
15 years ago
|
{
|
||
|
return mHostName;
|
||
|
}
|
||
|
|
||
14 years ago
|
void SensorProperties::setName( const TQString &name )
|
||
15 years ago
|
{
|
||
|
mName = name;
|
||
|
}
|
||
|
|
||
14 years ago
|
TQString SensorProperties::name() const
|
||
15 years ago
|
{
|
||
|
return mName;
|
||
|
}
|
||
|
|
||
14 years ago
|
void SensorProperties::setType( const TQString &type )
|
||
15 years ago
|
{
|
||
|
mType = type;
|
||
|
}
|
||
|
|
||
14 years ago
|
TQString SensorProperties::type() const
|
||
15 years ago
|
{
|
||
|
return mType;
|
||
|
}
|
||
|
|
||
14 years ago
|
void SensorProperties::setDescription( const TQString &description )
|
||
15 years ago
|
{
|
||
|
mDescription = description;
|
||
|
}
|
||
|
|
||
14 years ago
|
TQString SensorProperties::description() const
|
||
15 years ago
|
{
|
||
|
return mDescription;
|
||
|
}
|
||
|
|
||
14 years ago
|
void SensorProperties::setUnit( const TQString &unit )
|
||
15 years ago
|
{
|
||
|
mUnit = unit;
|
||
|
}
|
||
|
|
||
14 years ago
|
TQString SensorProperties::unit() const
|
||
15 years ago
|
{
|
||
|
return mUnit;
|
||
|
}
|
||
|
|
||
|
void SensorProperties::setIsOk( bool value )
|
||
|
{
|
||
|
mOk = value;
|
||
|
}
|
||
|
|
||
|
bool SensorProperties::isOk() const
|
||
|
{
|
||
|
return mOk;
|
||
|
}
|
||
|
|
||
|
#include "SensorDisplay.moc"
|