|
From: <le...@us...> - 2007-01-14 00:48:24
|
Revision: 162
http://svn.sourceforge.net/qcell/?rev=162&view=rev
Author: lessm
Date: 2007-01-13 16:48:22 -0800 (Sat, 13 Jan 2007)
Log Message:
-----------
- Some Bugs removed
- 1D edit panel add
Modified Paths:
--------------
trunk/qcell/baseheaders/simulationwindow.h
trunk/qcell/baseheaders/simulationwindow.ui
trunk/qcell/baseheaders/view2dtexttools.h
trunk/qcell/baseheaders/view2dtexttools.ui
trunk/qcell/basesources/simulationwindow.cpp
trunk/qcell/basesources/view2dtexttools.cpp
trunk/qcell/visgui/visgui.pro
Added Paths:
-----------
trunk/qcell/baseheaders/view1dtexttools.h
trunk/qcell/baseheaders/view1dtexttools.ui
trunk/qcell/basesources/view1dtexttools.cpp
Modified: trunk/qcell/baseheaders/simulationwindow.h
===================================================================
--- trunk/qcell/baseheaders/simulationwindow.h 2007-01-13 23:01:23 UTC (rev 161)
+++ trunk/qcell/baseheaders/simulationwindow.h 2007-01-14 00:48:22 UTC (rev 162)
@@ -17,6 +17,7 @@
#include "basetools.h"
#include "view3dtools.h"
#include "view2dtexttools.h"
+#include "view1dtexttools.h"
#include <QToolBox>
@@ -48,6 +49,11 @@
bool view2DTextColorFlag;
int view2DTextInterpretationMode;
+ View1DTextTools *view1DTextTools;
+
+ bool view1DTextColorFlag;
+ int view1DTextInterpretationMode;
+
char table2DUpdateRequest, table1DUpdateRequest, graph2DUpdateRequest;
QGraphicsView *graphicsView2D;
@@ -87,7 +93,9 @@
void GridView2DColor(bool flag);
void GrigView2DInterpretationMode(int mode);
- void GridView1DRepaint(void);
+ void GridView1DColor(bool flag);
+ void GrigView1DInterpretationMode(int mode);
+
void GridView1DMemClear(void);
void symbolTableChange(int row, int column);
Modified: trunk/qcell/baseheaders/simulationwindow.ui
===================================================================
--- trunk/qcell/baseheaders/simulationwindow.ui 2007-01-13 23:01:23 UTC (rev 161)
+++ trunk/qcell/baseheaders/simulationwindow.ui 2007-01-14 00:48:22 UTC (rev 162)
@@ -57,61 +57,6 @@
<attribute name="title" >
<string>1D Text View</string>
</attribute>
- <widget class="QCheckBox" name="Grig1DColors" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>10</y>
- <width>89</width>
- <height>18</height>
- </rect>
- </property>
- <property name="text" >
- <string>Enable Colors</string>
- </property>
- </widget>
- <widget class="QRadioButton" name="Grid1DValues" >
- <property name="geometry" >
- <rect>
- <x>110</x>
- <y>10</y>
- <width>54</width>
- <height>18</height>
- </rect>
- </property>
- <property name="text" >
- <string>Values</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- <widget class="QPushButton" name="memClr" >
- <property name="geometry" >
- <rect>
- <x>280</x>
- <y>10</y>
- <width>75</width>
- <height>23</height>
- </rect>
- </property>
- <property name="text" >
- <string>Clear Memory</string>
- </property>
- </widget>
- <widget class="QRadioButton" name="Grid1DSybmols" >
- <property name="geometry" >
- <rect>
- <x>200</x>
- <y>10</y>
- <width>63</width>
- <height>18</height>
- </rect>
- </property>
- <property name="text" >
- <string>Symbols</string>
- </property>
- </widget>
</widget>
<widget class="QWidget" name="symbolConfig" >
<attribute name="title" >
Added: trunk/qcell/baseheaders/view1dtexttools.h
===================================================================
--- trunk/qcell/baseheaders/view1dtexttools.h (rev 0)
+++ trunk/qcell/baseheaders/view1dtexttools.h 2007-01-14 00:48:22 UTC (rev 162)
@@ -0,0 +1,32 @@
+#ifndef VIEW1DTEXTTOOLS_H
+#define VIEW1DTEXTTOOLS_H
+
+#include <QWidget>
+#include "ui_view1dtexttools.h"
+
+class View1DTextTools : public QWidget
+{
+ Q_OBJECT
+
+public:
+ View1DTextTools(QWidget *parent = 0);
+ ~View1DTextTools();
+
+private:
+ Ui::View1DTextToolsClass ui;
+ bool colorFlag;
+ int textMode;
+
+protected slots:
+ void ColorsClick(void);
+ void ValuesClick(void);
+ void SymbolsClicks(void);
+ void memoryClearButtonClick(void);
+
+signals:
+ void colorsEnabled(bool flag);
+ void viewModeChenged(int mode);
+ void memoryClear(void);
+};
+
+#endif // VIEW1DTEXTTOOLS_H
Added: trunk/qcell/baseheaders/view1dtexttools.ui
===================================================================
--- trunk/qcell/baseheaders/view1dtexttools.ui (rev 0)
+++ trunk/qcell/baseheaders/view1dtexttools.ui 2007-01-14 00:48:22 UTC (rev 162)
@@ -0,0 +1,109 @@
+<ui version="4.0" >
+ <class>View1DTextToolsClass</class>
+ <widget class="QWidget" name="View1DTextToolsClass" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>102</width>
+ <height>145</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>View1DTextTools</string>
+ </property>
+ <widget class="QGroupBox" name="groupBox_2" >
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>90</y>
+ <width>100</width>
+ <height>51</height>
+ </rect>
+ </property>
+ <property name="title" >
+ <string>Memory</string>
+ </property>
+ <widget class="QToolButton" name="MemoryClearButton" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>81</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Clear</string>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
+ <y>1</y>
+ <width>100</width>
+ <height>91</height>
+ </rect>
+ </property>
+ <property name="title" >
+ <string>View 1D Text</string>
+ </property>
+ <widget class="QToolButton" name="ColorsButton" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>81</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Colors</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QToolButton" name="ValuesButton" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>40</y>
+ <width>81</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Values</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QToolButton" name="SymbolsButton" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>60</y>
+ <width>81</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Symbols</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </widget>
+ </widget>
+ <layoutdefault spacing="6" margin="11" />
+ <resources/>
+ <connections/>
+</ui>
Modified: trunk/qcell/baseheaders/view2dtexttools.h
===================================================================
--- trunk/qcell/baseheaders/view2dtexttools.h 2007-01-13 23:01:23 UTC (rev 161)
+++ trunk/qcell/baseheaders/view2dtexttools.h 2007-01-14 00:48:22 UTC (rev 162)
@@ -13,6 +13,7 @@
~View2DTextTools();
void Pure2DMode(bool flag=0);
void setZPlaneMax(int max);
+ void showZplaneOnly(bool flag=0);
private:
Ui::View2DTextToolsClass ui;
Modified: trunk/qcell/baseheaders/view2dtexttools.ui
===================================================================
--- trunk/qcell/baseheaders/view2dtexttools.ui 2007-01-13 23:01:23 UTC (rev 161)
+++ trunk/qcell/baseheaders/view2dtexttools.ui 2007-01-14 00:48:22 UTC (rev 162)
@@ -12,10 +12,33 @@
<property name="windowTitle" >
<string>View2DTextTools</string>
</property>
- <widget class="QGroupBox" name="groupBox" >
+ <widget class="QGroupBox" name="ZPlaneGroup" >
<property name="geometry" >
<rect>
<x>1</x>
+ <y>100</y>
+ <width>100</width>
+ <height>51</height>
+ </rect>
+ </property>
+ <property name="title" >
+ <string>Z Plane</string>
+ </property>
+ <widget class="QSpinBox" name="Zplane" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>20</y>
+ <width>71</width>
+ <height>22</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QGroupBox" name="View2DGroup" >
+ <property name="geometry" >
+ <rect>
+ <x>1</x>
<y>1</y>
<width>100</width>
<height>91</height>
@@ -76,29 +99,6 @@
</property>
</widget>
</widget>
- <widget class="QGroupBox" name="ZPlaneGroup" >
- <property name="geometry" >
- <rect>
- <x>1</x>
- <y>100</y>
- <width>100</width>
- <height>51</height>
- </rect>
- </property>
- <property name="title" >
- <string>Z Plane</string>
- </property>
- <widget class="QSpinBox" name="Zplane" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>20</y>
- <width>71</width>
- <height>22</height>
- </rect>
- </property>
- </widget>
- </widget>
</widget>
<layoutdefault spacing="6" margin="11" />
<resources/>
Modified: trunk/qcell/basesources/simulationwindow.cpp
===================================================================
--- trunk/qcell/basesources/simulationwindow.cpp 2007-01-13 23:01:23 UTC (rev 161)
+++ trunk/qcell/basesources/simulationwindow.cpp 2007-01-14 00:48:22 UTC (rev 162)
@@ -97,8 +97,8 @@
table2D->resize(ui.view2D->width() - 10 , ui.view2D->height() - 10);
graphicsView2D->resize(ui.view2DGraph->width() - 7, ui.view2DGraph->height() - 7);
- table1D->move(0, 35);
- table1D->resize(ui.view1D->width() - 7, 45);
+ table1D->move(1, 1);
+ table1D->resize(ui.view1D->width() - 10, 75);
table1DMem->move(0, 100);
table1DMem->resize(ui.view1D->width() - 7, ui.view1D->height() - 157);
@@ -109,6 +109,7 @@
basetools->move(width() - 101, 0);
view3DTools->move(width() - 101, basetools->height() + 1);
view2DTextTools->move(width() - 101, basetools->height() + 1);
+ view1DTextTools->move(width() - 101, basetools->height() + 1);
}
@@ -124,6 +125,7 @@
if(ui.view2D->isVisible())
{
view2DTextTools->show();
+ view2DTextTools->showZplaneOnly(0);
if(table2DUpdateRequest>0)
{
if(table2DUpdateRequest==1)
@@ -134,19 +136,30 @@
}
}
else
- view2DTextTools->hide();
+ {
+ if(!ui.view2DGraph->isVisible())
+ view2DTextTools->hide();
+ }
if(ui.view2DGraph->isVisible())
{
+ view2DTextTools->show();
+ view2DTextTools->showZplaneOnly(1);
if(graph2DUpdateRequest)
{
update2DGraph();
graph2DUpdateRequest = 0;
}
}
+ else
+ {
+ if(!ui.view2D->isVisible())
+ view2DTextTools->hide();
+ }
if(ui.view1D->isVisible())
{
+ view1DTextTools->show();
if(table1DUpdateRequest)
{
if(table1DUpdateRequest==1)
@@ -156,6 +169,8 @@
table1DUpdateRequest = 0;
}
}
+ else
+ view1DTextTools->hide();
if(ui.symbolConfig->isVisible())
{
@@ -312,15 +327,15 @@
symbol = renderer->getSymbol(index);
table1D->setColumnWidth(x, 30);
table1DMem->setColumnWidth(x, 30);
- if(ui.Grid1DSybmols->isChecked())
+ if(view1DTextInterpretationMode==0)
+ item = new QTableWidgetItem(tr("%1").arg(index));
+ else
item = new QTableWidgetItem(tr("%1").arg(symbol.textSybmol));
- else
- item = new QTableWidgetItem(tr("%1").arg(index));
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
item->setTextAlignment(Qt::AlignCenter);
- if(ui.Grig1DColors->isChecked())
+ if(view1DTextColorFlag)
{
item->setBackgroundColor(symbol.color);
item->setTextColor(symbol.textColor);
@@ -343,7 +358,7 @@
index = renderer->getSymbolCount() - 1;
symbol = renderer->getSymbol(index);
item = table1D->item(0, x);
- if(ui.Grid1DValues->isChecked())
+ if(view1DTextInterpretationMode==0)
{
tmpString.setNum(index);
if(item->text()!=tmpString)
@@ -363,7 +378,7 @@
if(needUpdate)
{
item->setTextColor(Qt::black);
- if(ui.Grig1DColors->isChecked())
+ if(view1DTextColorFlag)
{
item->setBackgroundColor(symbol.color);
item->setTextColor(symbol.textColor);
@@ -514,13 +529,9 @@
connect(renderer->getStorage(), SIGNAL(dataUpdated()), SLOT(dataUpdateRequest()));
- connect(ui.Grid1DSybmols, SIGNAL(clicked(bool)), SLOT(GridView1DRepaint()));
- connect(ui.Grid1DValues, SIGNAL(clicked(bool)), SLOT(GridView1DRepaint()));
- connect(ui.Grig1DColors, SIGNAL(clicked(bool)), SLOT(GridView1DRepaint()));
-
connect(renderer->getStorage(), SIGNAL(dataResized()), SLOT(dataResizeRequest()));
- connect(ui.memClr, SIGNAL(clicked(bool)), SLOT(GridView1DMemClear()));
+
connect(symbolTable, SIGNAL(cellChanged(int, int)), SLOT(symbolTableChange(int, int)));
connect(symbolTable, SIGNAL(cellDoubleClicked(int, int)), SLOT(symbolTableColorChange(int, int)));
@@ -547,13 +558,21 @@
view3DTools = new View3DTools(this);
connect(view3DTools, SIGNAL(ViewModeUpdated(int)), SLOT(perspectiveUpdate(int)));
- view2DTextTools = new View2DTextTools(this);
view2DTextColorFlag = 0;
view2DTextInterpretationMode = 0;
+ view2DTextTools = new View2DTextTools(this);
+
connect(view2DTextTools, SIGNAL(newZPlaneSet(int)), SLOT(zPlaneChange(int)));
connect(view2DTextTools, SIGNAL(colorsEnabled(bool)), SLOT(GridView2DColor(bool)));
connect(view2DTextTools, SIGNAL(viewModeChenged(int)), SLOT(GrigView2DInterpretationMode(int)));
+ view1DTextColorFlag = 0;
+ view1DTextInterpretationMode = 0;
+ view1DTextTools = new View1DTextTools(this);
+
+ connect(view1DTextTools, SIGNAL(colorsEnabled(bool)), SLOT(GridView1DColor(bool)));
+ connect(view1DTextTools, SIGNAL(viewModeChenged(int)), SLOT(GrigView1DInterpretationMode(int)));
+ connect(view1DTextTools, SIGNAL(memoryClear()), SLOT(GridView1DMemClear()));
}
simulationWindow::~simulationWindow()
@@ -580,8 +599,16 @@
{
z_plane = i;
if(ui.view2D->isVisible())
+ {
update2DTable();
- graph2DUpdateRequest = 1;
+ graph2DUpdateRequest = 1;
+ }
+ else
+ {
+ table2DUpdateRequest = 1;
+ if(ui.view2DGraph->isVisible())
+ update2DGraph();
+ }
}
void simulationWindow::dataUpdateRequest(void)
@@ -621,6 +648,7 @@
ui.tabWidget->setTabEnabled(1, 0);
ui.tabWidget->setTabEnabled(2, 0);
ui.tabWidget->setTabEnabled(3, 1);
+ table1DUpdateRequest = 2;
break;
case 2:
@@ -629,6 +657,7 @@
ui.tabWidget->setTabEnabled(2, 1);
ui.tabWidget->setTabEnabled(3, 0);
table2DUpdateRequest = 2;
+ graph2DUpdateRequest = 1;
view2DTextTools->setZPlaneMax(0);
view2DTextTools->Pure2DMode(1);
@@ -640,10 +669,12 @@
ui.tabWidget->setTabEnabled(2, 1);
ui.tabWidget->setTabEnabled(3, 0);
table2DUpdateRequest = 2;
+ graph2DUpdateRequest = 1;
view2DTextTools->setZPlaneMax(getStorage()->getSizeZ()-1);
view2DTextTools->Pure2DMode(0);
break;
}
+ repaint();
}
void simulationWindow::GridView2DColor(bool flag)
@@ -658,11 +689,18 @@
update2DTable(1);
}
-void simulationWindow::GridView1DRepaint()
+void simulationWindow::GridView1DColor(bool flag)
{
+ view1DTextColorFlag = flag;
update1DTable(1);
}
+void simulationWindow::GrigView1DInterpretationMode(int mode)
+{
+ view1DTextInterpretationMode = mode;
+ update1DTable(1);
+}
+
void simulationWindow::GridView1DMemClear(void)
{
while(table1DMem->rowCount()>0)
@@ -710,7 +748,7 @@
renderer->setSymbolColor(row, color);
renderer->repaint();
- if(ui.Grig1DColors->isChecked())
+ if(view1DTextColorFlag)
table1DUpdateRequest = 2;
if(view2DTextColorFlag)
@@ -795,6 +833,7 @@
item->setBackgroundColor(Qt::white);
}
}
+ graph2DUpdateRequest = 1;
}
}
@@ -809,7 +848,7 @@
changeSymbol(column, 0, 0);
item = table1D->item(0, column);
symbol = renderer->getSymbol(selectedSymbol);
- if(ui.Grid1DValues->isChecked())
+ if(view1DTextInterpretationMode==0)
{
tmpString.setNum(selectedSymbol);
if(item->text()!=tmpString)
@@ -829,7 +868,7 @@
if(needUpdate)
{
item->setTextColor(Qt::black);
- if(ui.Grig1DColors->isChecked())
+ if(view1DTextColorFlag)
{
item->setBackgroundColor(symbol.color);
item->setTextColor(symbol.textColor);
Added: trunk/qcell/basesources/view1dtexttools.cpp
===================================================================
--- trunk/qcell/basesources/view1dtexttools.cpp (rev 0)
+++ trunk/qcell/basesources/view1dtexttools.cpp 2007-01-14 00:48:22 UTC (rev 162)
@@ -0,0 +1,55 @@
+#include "view1dtexttools.h"
+
+View1DTextTools::View1DTextTools(QWidget *parent)
+ : QWidget(parent)
+{
+ ui.setupUi(this);
+
+ colorFlag = 0;
+ textMode = 0;
+
+ connect(ui.ColorsButton, SIGNAL(clicked(bool)), SLOT(ColorsClick()));
+ connect(ui.SymbolsButton, SIGNAL(clicked(bool)), SLOT(SymbolsClicks()));
+ connect(ui.ValuesButton, SIGNAL(clicked(bool)), SLOT(ValuesClick()));
+ connect(ui.MemoryClearButton, SIGNAL(clicked(bool)), SLOT(memoryClearButtonClick()));
+}
+
+View1DTextTools::~View1DTextTools()
+{
+
+}
+
+void View1DTextTools::ColorsClick(void)
+{
+ if(ui.ColorsButton->isChecked())
+ emit colorsEnabled(1);
+ else
+ emit colorsEnabled(0);
+}
+
+void View1DTextTools::ValuesClick(void)
+{
+ ui.ValuesButton->setChecked(1);
+ ui.SymbolsButton->setChecked(0);
+ if(textMode!=0)
+ {
+ textMode = 0;
+ emit viewModeChenged(0);
+ }
+}
+
+void View1DTextTools::SymbolsClicks(void)
+{
+ ui.ValuesButton->setChecked(0);
+ ui.SymbolsButton->setChecked(1);
+ if(textMode!=1)
+ {
+ textMode = 1;
+ emit viewModeChenged(1);
+ }
+}
+
+void View1DTextTools::memoryClearButtonClick(void)
+{
+ emit memoryClear();
+}
Modified: trunk/qcell/basesources/view2dtexttools.cpp
===================================================================
--- trunk/qcell/basesources/view2dtexttools.cpp 2007-01-13 23:01:23 UTC (rev 161)
+++ trunk/qcell/basesources/view2dtexttools.cpp 2007-01-14 00:48:22 UTC (rev 162)
@@ -31,6 +31,14 @@
ui.Zplane->setRange(0, max);
}
+void View2DTextTools::showZplaneOnly(bool flag)
+{
+ if(!flag)
+ ui.View2DGroup->show();
+ else
+ ui.View2DGroup->hide();
+}
+
void View2DTextTools::ColorsClick(void)
{
if(ui.ColorsButton->isChecked())
Modified: trunk/qcell/visgui/visgui.pro
===================================================================
--- trunk/qcell/visgui/visgui.pro 2007-01-13 23:01:23 UTC (rev 161)
+++ trunk/qcell/visgui/visgui.pro 2007-01-14 00:48:22 UTC (rev 162)
@@ -11,7 +11,8 @@
../baseheaders/simulationwindow.ui \
../baseheaders/basetools.ui \
../baseheaders/view3dtools.ui \
- ../baseheaders/view2dtexttools.ui
+ ../baseheaders/view2dtexttools.ui \
+ ../baseheaders/view1dtexttools.ui
HEADERS = MainWindow.h \
ExperimentSetup.h \
../baseheaders/Client.h \
@@ -27,7 +28,8 @@
../baseheaders/Calculator.h\
../baseheaders/basetools.h \
../baseheaders/view3dtools.h \
- ../baseheaders/view2dtexttools.h
+ ../baseheaders/view2dtexttools.h \
+ ../baseheaders/view1dtexttools.h
SOURCES = ../basesources/GenericParserPlugin.cpp \
main.cpp \
@@ -43,7 +45,8 @@
../basesources/Calculator.cpp \
../basesources/basetools.cpp \
../basesources/view3dtools.cpp \
- ../basesources/view2dtexttools.cpp
+ ../basesources/view2dtexttools.cpp \
+ ../basesources/view1dtexttools.cpp
LIBS = -L../libs -lN -lFQT -lKI
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|