1 // Copyright (C) 2006-2008 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include "SchemaProcItem.hxx"
21 #include "QtGuiContext.hxx"
24 #include "YacsTrace.hxx"
27 using namespace YACS::ENGINE;
28 using namespace YACS::HMI;
31 SchemaProcItem::SchemaProcItem(SchemaItem *parent, QString label, Subject* subject)
32 : SchemaComposedNodeItem(parent, label, subject)
34 DEBTRACE("SchemaProcItem::SchemaProcItem");
37 SchemaProcItem::~SchemaProcItem()
39 DEBTRACE("SchemaProcItem::~SchemaProcItem");
42 void SchemaProcItem::popupMenu(QWidget *caller, const QPoint &globalPos)
45 m.popupMenu(caller, globalPos);
48 void SchemaProcItem::setExecState(int execState)
50 DEBTRACE("SchemaProcItem::setExecState " << execState);
51 _execState = execState;
56 case YACS::NOTYETINITIALIZED: sc.setHsv( 45, 50, 255); stateDef = "Not Yet Initialized"; break;
57 case YACS::INITIALISED: sc.setHsv( 90, 50, 255); stateDef = "Initialized"; break;
58 case YACS::RUNNING: sc.setHsv(135, 50, 255); stateDef = "Running"; break;
59 case YACS::WAITINGTASKS: sc.setHsv(180, 50, 255); stateDef = "Waiting Tasks"; break;
60 case YACS::PAUSED: sc.setHsv(225, 50, 255); stateDef = "Paused"; break;
61 case YACS::FINISHED: sc.setHsv(270, 50, 255); stateDef = "Finished"; break;
62 case YACS::STOPPED: sc.setHsv(315, 50, 255); stateDef = "Stopped"; break;
63 default: sc.setHsv(360, 50, 255); stateDef = "Unknown Status";
65 _itemData.replace(YState, stateDef);
66 _itemForeground.replace(YState, Qt::darkBlue);
67 _itemBackground.replace(YState, sc);