Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
2d6e556a
Kaydet (Commit)
2d6e556a
authored
Ara 31, 2013
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
first try at implementing time based updates in new chart implementation
Change-Id: I3d03e44a415023ca12548ea99a3732cba49c8074
üst
46574ef1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
3 deletions
+67
-3
Library_chartcore.mk
chart2/Library_chartcore.mk
+1
-0
ChartView.hxx
chart2/inc/ChartView.hxx
+17
-1
ChartModel.cxx
chart2/source/model/main/ChartModel.cxx
+2
-0
ChartView.cxx
chart2/source/view/main/ChartView.cxx
+47
-2
No files found.
chart2/Library_chartcore.mk
Dosyayı görüntüle @
2d6e556a
...
@@ -46,6 +46,7 @@ $(eval $(call gb_Library_use_libraries,chartcore,\
...
@@ -46,6 +46,7 @@ $(eval $(call gb_Library_use_libraries,chartcore,\
fwe \
fwe \
i18nlangtag \
i18nlangtag \
sal \
sal \
salhelper \
sfx \
sfx \
svl \
svl \
svt \
svt \
...
...
chart2/inc/ChartView.hxx
Dosyayı görüntüle @
2d6e556a
...
@@ -45,6 +45,8 @@
...
@@ -45,6 +45,8 @@
#include <boost/shared_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <salhelper/thread.hxx>
class
SdrPage
;
class
SdrPage
;
namespace
chart
{
namespace
chart
{
...
@@ -54,14 +56,25 @@ class DrawModelWrapper;
...
@@ -54,14 +56,25 @@ class DrawModelWrapper;
class
SeriesPlotterContainer
;
class
SeriesPlotterContainer
;
class
VDataSeries
;
class
VDataSeries
;
enum
TimeBasedMode
{
MANUAL
,
AUTOMATIC
,
AUTOMATIC_WRAP
};
struct
TimeBasedInfo
struct
TimeBasedInfo
{
{
TimeBasedInfo
()
:
TimeBasedInfo
()
:
bTimeBased
(
false
),
bTimeBased
(
false
),
nFrame
(
0
)
{}
nFrame
(
0
),
eMode
(
AUTOMATIC
),
mpThread
(
NULL
)
{}
bool
bTimeBased
;
bool
bTimeBased
;
size_t
nFrame
;
size_t
nFrame
;
TimeBasedMode
eMode
;
salhelper
::
Thread
*
mpThread
;
// only valid when we are in the time based mode
// only valid when we are in the time based mode
::
std
::
vector
<
std
::
vector
<
VDataSeries
*
>
>
m_aDataSeriesList
;
::
std
::
vector
<
std
::
vector
<
VDataSeries
*
>
>
m_aDataSeriesList
;
...
@@ -181,6 +194,8 @@ public:
...
@@ -181,6 +194,8 @@ public:
virtual
OUString
SAL_CALL
dump
()
virtual
OUString
SAL_CALL
dump
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
void
setViewDirty
();
private
:
//methods
private
:
//methods
ChartView
();
ChartView
();
...
@@ -254,6 +269,7 @@ private: //member
...
@@ -254,6 +269,7 @@ private: //member
::
com
::
sun
::
star
::
awt
::
Rectangle
m_aResultingDiagramRectangleExcludingAxes
;
::
com
::
sun
::
star
::
awt
::
Rectangle
m_aResultingDiagramRectangleExcludingAxes
;
TimeBasedInfo
maTimeBased
;
TimeBasedInfo
maTimeBased
;
osl
::
Mutex
maTimeMutex
;
};
};
}
}
...
...
chart2/source/model/main/ChartModel.cxx
Dosyayı görüntüle @
2d6e556a
...
@@ -93,6 +93,7 @@ ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext)
...
@@ -93,6 +93,7 @@ ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext)
,
m_bModified
(
sal_False
)
,
m_bModified
(
sal_False
)
,
m_nInLoad
(
0
)
,
m_nInLoad
(
0
)
,
m_bUpdateNotificationsPending
(
false
)
,
m_bUpdateNotificationsPending
(
false
)
,
mbTimeBased
(
true
)
,
mpChartView
(
NULL
)
,
mpChartView
(
NULL
)
,
m_pUndoManager
(
NULL
)
,
m_pUndoManager
(
NULL
)
,
m_aControllers
(
m_aModelMutex
)
,
m_aControllers
(
m_aModelMutex
)
...
@@ -131,6 +132,7 @@ ChartModel::ChartModel( const ChartModel & rOther )
...
@@ -131,6 +132,7 @@ ChartModel::ChartModel( const ChartModel & rOther )
,
m_bModified
(
rOther
.
m_bModified
)
,
m_bModified
(
rOther
.
m_bModified
)
,
m_nInLoad
(
0
)
,
m_nInLoad
(
0
)
,
m_bUpdateNotificationsPending
(
false
)
,
m_bUpdateNotificationsPending
(
false
)
,
mbTimeBased
(
rOther
.
mbTimeBased
)
,
mpChartView
(
NULL
)
,
mpChartView
(
NULL
)
,
m_aResource
(
rOther
.
m_aResource
)
,
m_aResource
(
rOther
.
m_aResource
)
,
m_aMediaDescriptor
(
rOther
.
m_aMediaDescriptor
)
,
m_aMediaDescriptor
(
rOther
.
m_aMediaDescriptor
)
...
...
chart2/source/view/main/ChartView.cxx
Dosyayı görüntüle @
2d6e556a
...
@@ -108,6 +108,9 @@
...
@@ -108,6 +108,9 @@
#include <rtl/strbuf.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustring.hxx>
#include <osl/conditn.hxx>
#include <osl/time.h>
#include <boost/shared_ptr.hpp>
#include <boost/shared_ptr.hpp>
namespace
chart
{
namespace
chart
{
...
@@ -121,6 +124,30 @@ using ::com::sun::star::uno::Any;
...
@@ -121,6 +124,30 @@ using ::com::sun::star::uno::Any;
namespace
namespace
{
{
class
theExplicitValueProviderUnoTunnelId
:
public
rtl
::
Static
<
UnoTunnelIdInit
,
theExplicitValueProviderUnoTunnelId
>
{};
class
theExplicitValueProviderUnoTunnelId
:
public
rtl
::
Static
<
UnoTunnelIdInit
,
theExplicitValueProviderUnoTunnelId
>
{};
class
UpdateTimeBasedThread
:
public
salhelper
::
Thread
{
public
:
UpdateTimeBasedThread
(
ChartView
&
rChartView
,
TimeBasedInfo
&
rTimeBasedInfo
)
:
salhelper
::
Thread
(
"ChartUpdate"
),
mrChartView
(
rChartView
),
mrTimeBasedInfo
(
rTimeBasedInfo
)
{}
private
:
virtual
void
execute
()
{
TimeValue
const
aTime
=
{
0
,
100
};
for
(
size_t
i
=
0
;
i
<
60
;
++
i
)
{
mrChartView
.
setViewDirty
();
mrChartView
.
update
();
wait
(
aTime
);
}
}
ChartView
&
mrChartView
;
TimeBasedInfo
&
mrTimeBasedInfo
;
};
}
}
const
uno
::
Sequence
<
sal_Int8
>&
ExplicitValueProvider
::
getUnoTunnelId
()
const
uno
::
Sequence
<
sal_Int8
>&
ExplicitValueProvider
::
getUnoTunnelId
()
...
@@ -2369,9 +2396,20 @@ void ChartView::createShapes()
...
@@ -2369,9 +2396,20 @@ void ChartView::createShapes()
clock_t
nStart
=
clock
();
clock_t
nStart
=
clock
();
OSL_TRACE
(
"
\n
PPPPPPPPP>>>>>>>>>>>> chart view :: createShapes()"
);
OSL_TRACE
(
"
\n
PPPPPPPPP>>>>>>>>>>>> chart view :: createShapes()"
);
#endif
#endif
osl
::
ResettableMutexGuard
aTimedGuard
(
maTimeMutex
);
if
(
mrChartModel
.
isTimeBased
())
if
(
mrChartModel
.
isTimeBased
())
{
maTimeBased
.
bTimeBased
=
true
;
maTimeBased
.
bTimeBased
=
true
;
if
(
!
maTimeBased
.
mpThread
)
{
maTimeBased
.
mpThread
=
new
UpdateTimeBasedThread
(
*
this
,
maTimeBased
);
maTimeBased
.
mpThread
->
launch
();
}
}
//make sure add-in is refreshed after creating the shapes
//make sure add-in is refreshed after creating the shapes
const
::
comphelper
::
ScopeGuard
aGuard
(
boost
::
bind
(
&
ChartView
::
impl_refreshAddIn
,
this
)
);
const
::
comphelper
::
ScopeGuard
aGuard
(
boost
::
bind
(
&
ChartView
::
impl_refreshAddIn
,
this
)
);
if
(
impl_AddInDrawsAllByItself
()
)
if
(
impl_AddInDrawsAllByItself
()
)
...
@@ -2444,7 +2482,7 @@ void ChartView::createShapes()
...
@@ -2444,7 +2482,7 @@ void ChartView::createShapes()
SeriesPlotterContainer
aSeriesPlotterContainer
(
m_aVCooSysList
);
SeriesPlotterContainer
aSeriesPlotterContainer
(
m_aVCooSysList
);
aSeriesPlotterContainer
.
initializeCooSysAndSeriesPlotter
(
mrChartModel
);
aSeriesPlotterContainer
.
initializeCooSysAndSeriesPlotter
(
mrChartModel
);
if
(
maTimeBased
.
bTimeBased
)
if
(
maTimeBased
.
bTimeBased
&&
maTimeBased
.
nFrame
!=
0
)
{
{
std
::
vector
<
VSeriesPlotter
*>&
rSeriesPlotter
=
std
::
vector
<
VSeriesPlotter
*>&
rSeriesPlotter
=
aSeriesPlotterContainer
.
getSeriesPlotterList
();
aSeriesPlotterContainer
.
getSeriesPlotterList
();
...
@@ -2549,6 +2587,8 @@ void ChartView::createShapes()
...
@@ -2549,6 +2587,8 @@ void ChartView::createShapes()
//cleanup: remove all empty group shapes to avoid grey border lines:
//cleanup: remove all empty group shapes to avoid grey border lines:
lcl_removeEmptyGroupShapes
(
mxRootShape
);
lcl_removeEmptyGroupShapes
(
mxRootShape
);
pShapeFactory
->
render
(
mxRootShape
);
if
(
maTimeBased
.
bTimeBased
&&
maTimeBased
.
nFrame
%
60
==
0
)
if
(
maTimeBased
.
bTimeBased
&&
maTimeBased
.
nFrame
%
60
==
0
)
{
{
// create copy of the data for next frame
// create copy of the data for next frame
...
@@ -2582,7 +2622,6 @@ void ChartView::createShapes()
...
@@ -2582,7 +2622,6 @@ void ChartView::createShapes()
m_pDrawModelWrapper
->
getSdrModel
().
EnableUndo
(
true
);
m_pDrawModelWrapper
->
getSdrModel
().
EnableUndo
(
true
);
}
}
pShapeFactory
->
render
(
mxRootShape
);
if
(
maTimeBased
.
bTimeBased
)
if
(
maTimeBased
.
bTimeBased
)
{
{
...
@@ -3007,6 +3046,12 @@ OUString ChartView::dump() throw (uno::RuntimeException)
...
@@ -3007,6 +3046,12 @@ OUString ChartView::dump() throw (uno::RuntimeException)
}
}
void
ChartView
::
setViewDirty
()
{
osl
::
ResettableMutexGuard
aGuard
(
maTimeMutex
);
m_bViewDirty
=
true
;
}
}
//namespace chart
}
//namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment