Work with graphic library rmchart

This forum is for eXpress++ general support.
Message
Author
User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Work with graphic library rmchart

#1 Post by Eugene Lutsenko »

System development in which I am engaged, approached to a stage when I directly, closely start using rmchart graphics. In this regard at me arose a number of specific questions and I ask your help in their decision. First of all I faced that included files:

#include "dcgraph.ch"
#include "dcprint.ch"
#include "dcreg.ch"
#include "rmchart.ch"

give an error of repeated definition (Redefinition ).
For example, rmchart.ch gives:

Code: Select all

c:\ALLDLLCH\\rmchart.ch(451:0): warning XBT0110: Redefinition or duplicate definition of #define TRUE
c:\ALLDLLCH\\rmchart.ch(452:0): warning XBT0110: Redefinition or duplicate definition of #define FALSE
Couldn't prompt what to do?

Wolfgang Ciriack
Posts: 479
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: Work with graphic library rmchart

#2 Post by Wolfgang Ciriack »

You can put f.e. a
#ifndef TRUE
#define TRUE ...
#endif
in the rmchart.ch, if the defines of TRUE are equal with the defines in the other .ch-file.
_______________________
Best Regards
Wolfgang

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Work with graphic library rmchart

#3 Post by Eugene Lutsenko »

Problem not only in it. Errors of redefinition meet in very many lines and the ch-files given above clash with each other:

Code: Select all

D:\ALASKA\AIDOS-X>CLS
D:\ALASKA\AIDOS-X>ARC _Aidos.arc 
D:\ALASKA\AIDOS-X>XPP DCCHART 
c:\ALLDLLCH\\rmchart.ch(5:0): warning XBT0110: Redefinition or duplicate definition of #define
        AliceBlue
c:\ALLDLLCH\\rmchart.ch(6:0): warning XBT0110: Redefinition or duplicate definition of #define
        AntiqueWhite
c:\ALLDLLCH\\rmchart.ch(7:0): warning XBT0110: Redefinition or duplicate definition of #define
        Aquamarine
c:\ALLDLLCH\\rmchart.ch(8:0): warning XBT0110: Redefinition or duplicate definition of #define
        ArmyGreen
c:\ALLDLLCH\\rmchart.ch(9:0): warning XBT0110: Redefinition or duplicate definition of #define
        AutumnOrange
c:\ALLDLLCH\\rmchart.ch(10:0): warning XBT0110: Redefinition or duplicate definition of #define
        AvocadoGreen
c:\ALLDLLCH\\rmchart.ch(11:0): warning XBT0110: Redefinition or duplicate definition of #define
        Azure
c:\ALLDLLCH\\rmchart.ch(12:0): warning XBT0110: Redefinition or duplicate definition of #define
        BabyBlue
c:\ALLDLLCH\\rmchart.ch(13:0): warning XBT0110: Redefinition or duplicate definition of #define
        BananaYellow
c:\ALLDLLCH\\rmchart.ch(14:0): warning XBT0110: Redefinition or duplicate definition of #define
        Beige
c:\ALLDLLCH\\rmchart.ch(15:0): warning XBT0110: Redefinition or duplicate definition of #define
        Bisque
c:\ALLDLLCH\\rmchart.ch(16:0): warning XBT0110: Redefinition or duplicate definition of #define
        Black
c:\ALLDLLCH\\rmchart.ch(17:0): warning XBT0110: Redefinition or duplicate definition of #define
        BlanchedAlmond
c:\ALLDLLCH\\rmchart.ch(18:0): warning XBT0110: Redefinition or duplicate definition of #define
        Blue
c:\ALLDLLCH\\rmchart.ch(19:0): warning XBT0110: Redefinition or duplicate definition of #define
        BlueViolet
c:\ALLDLLCH\\rmchart.ch(20:0): warning XBT0110: Redefinition or duplicate definition of #define
        Brown
c:\ALLDLLCH\\rmchart.ch(21:0): warning XBT0110: Redefinition or duplicate definition of #define
        BurlyWood
c:\ALLDLLCH\\rmchart.ch(22:0): warning XBT0110: Redefinition or duplicate definition of #define
        CadetBlue
c:\ALLDLLCH\\rmchart.ch(23:0): warning XBT0110: Redefinition or duplicate definition of #define
        Chalk
c:\ALLDLLCH\\rmchart.ch(24:0): warning XBT0110: Redefinition or duplicate definition of #define
        Chartreuse
c:\ALLDLLCH\\rmchart.ch(25:0): warning XBT0110: Redefinition or duplicate definition of #define
        Chocolate
c:\ALLDLLCH\\rmchart.ch(26:0): warning XBT0110: Redefinition or duplicate definition of #define
        Coral
c:\ALLDLLCH\\rmchart.ch(27:0): warning XBT0110: Redefinition or duplicate definition of #define
        CornflowerBlue
c:\ALLDLLCH\\rmchart.ch(28:0): warning XBT0110: Redefinition or duplicate definition of #define
        Cornsilk
c:\ALLDLLCH\\rmchart.ch(29:0): warning XBT0110: Redefinition or duplicate definition of #define
        Crimson
c:\ALLDLLCH\\rmchart.ch(30:0): warning XBT0110: Redefinition or duplicate definition of #define
        Cyan
c:\ALLDLLCH\\rmchart.ch(31:0): warning XBT0110: Redefinition or duplicate definition of #define
        DarkBlue
c:\ALLDLLCH\\rmchart.ch(32:0): warning XBT0110: Redefinition or duplicate definition of #define
        DarkBrown
c:\ALLDLLCH\\rmchart.ch(33:0): warning XBT0110: Redefinition or duplicate definition of #define

***********************************************************
c:\ALLDLLCH\\RMCHART.CH(443:0): warning XBT0110: Redefinition or duplicate definition of #define
        ResetIt
c:\ALLDLLCH\\RMCHART.CH(446:0): warning XBT0110: Redefinition or duplicate definition of #define
        RetDouble
c:\ALLDLLCH\\RMCHART.CH(447:0): warning XBT0110: Redefinition or duplicate definition of #define
        RetLong
c:\ALLDLLCH\\RMCHART.CH(448:0): warning XBT0110: Redefinition or duplicate definition of #define
        RetString
c:\ALLDLLCH\\RMCHART.CH(451:0): warning XBT0110: Redefinition or duplicate definition of #define
        TRUE
c:\ALLDLLCH\\RMCHART.CH(452:0): warning XBT0110: Redefinition or duplicate definition of #define
        FALSE

D:\ALASKA\AIDOS-X>ALINK DCCHART _Aidos.res /PM:PM 
Alaska 32-Bit Linker Version 1.90.355
Copyright (c) Alaska Software 1997-2009. All rights reserved.

DCCHART.obj: error ALK2102: unresolved external symbol DC_REGQUERY
DCCHART.obj: error ALK2102: unresolved external symbol DC_WINALERT
DCCHART.obj: error ALK2102: unresolved external symbol DC_GETTEMPLATE
DCCHART.obj: error ALK2102: unresolved external symbol DC_GETLISTSET
DCCHART.obj: error ALK2102: unresolved external symbol DC_GETANCHORCB
DCCHART.obj: error ALK2102: unresolved external symbol DC_GETREFRESH
DCCHART.obj: error ALK2102: unresolved external symbol DC_READGUI
DCCHART.obj: error ALK2102: unresolved external symbol DC_RANDOM
DCCHART.obj: error ALK2102: unresolved external symbol DC_BROWPRES
DCCHART.obj: error ALK2102: unresolved external symbol DC_INSPECTOBJECT
DCCHART.obj: error ALK2102: unresolved external symbol DC_PATH
DCCHART.obj: error ALK2102: unresolved external symbol DC_MSGBOX
DCCHART.obj: error ALK2102: unresolved external symbol DC_SPAWNURL
DCCHART.obj: error ALK2102: unresolved external symbol DC_READEMPTY
DCCHART.obj: error ALK2102: unresolved external symbol DC_POPFILE
DCCHART.obj: error ALK2102: unresolved external symbol DC_GETIDDEFAULT
ALINK: fatal error ALK4102: 16 external symbols unresolved
[/size]
Last edited by Eugene Lutsenko on Sat Mar 09, 2013 9:05 pm, edited 4 times in total.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Work with graphic library rmchart

#4 Post by Eugene Lutsenko »

I would like to use for obtaining the executable file not the project:

Code: Select all

//
// Project - Definition - File created by PBUILD Version  1.90.331
// Date: 06/09/2008 Time: 08:26:40
//

[PROJECT]
    COMPILE       = xpp
    COMPILE_FLAGS = /q /w /p /rDCLIPX.LIB /rDCLIP1.LIB
    DEBUG         = yes
    GUI           = yes
    LINKER        = alink
    LINK_FLAGS    =
    RC_COMPILE    = arc
    RC_FLAGS      = /v
    DCCHART.XPJ

[DCCHART.XPJ]
    DCCHART.EXE

[DCCHART.EXE]
// $START-AUTODEPEND
    DCCHART.OBJ
    STD.CH
    SET.CH
    NATMSG.CH
    GET.CH
    PROMPT.CH
    MEMVAR.CH
    COLLAT.CH
    DCDIALOG.CH
    XBP.CH
    GRA.CH
    DCREG.CH
    DCGRAPH.CH
    RMCHART.CH
// $STOP-AUTODEPEND
    DCCHART.PRG
and to do it in primitive style:

Code: Select all

CLS
ARC _Aidos.arc
XPP %1
ALINK %1 _Aidos.res /PM:PM
[/size]
Probably because of it all problems and it at me turns out. And the project works perfectly
Last edited by Eugene Lutsenko on Sun Mar 10, 2013 12:07 am, edited 1 time in total.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Work with graphic library rmchart

#5 Post by Eugene Lutsenko »

Everything well turned out!

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Work with graphic library rmchart

#6 Post by Eugene Lutsenko »

You couldn't give a source text of the MINIMUM program by the size, providing formation of this drawing:

Image

And that I try to allocate in a source text of the DCCHART.PRG program all necessary and sufficient for this purpose and it is impossible.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Work with graphic library rmchart

#7 Post by Eugene Lutsenko »

It seems that is necessary for me started turning out.
Many thanks for library and examples with source texts and comments!

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Work with graphic library rmchart

#8 Post by Eugene Lutsenko »

You couldn't prompt how to order the image:
- to lift the lower part of the schedule;
- to clean inscriptions on meaning points on graphics;
- to sign an axis X.

Image

Code: Select all

****************************************************************************************************************************************
*** 3.7.1. Поиск и удаление артефактов (робастная процедура)
***        Строится частотное распределение абсолютных частот встреч признаков в классах по матрице сопряженности Abs.dbf
***        и пользователю предоставляется возможность удалить редко встречающиеся факты (сочетания), как случайные выбросы или артефакты
****************************************************************************************************************************************
FUNCTION F3_7_1()

LOCAL GetList[0], GetOptions, oRmChart, oRegion1, oRegion2, oRegion3, ;
      oRegion4, oRegion5, oRegion6, aBarGroup[0], aLineGroup[0], aPie[0], ;
      aDonut[0], aBarGroupFloat[0], aBarGroupIndus[0], aLineGroupIndus[0], ;
      aDataAxis1[0], aDataAxis5[0], aDataAxis6[0], cRegSvr, ;
      cRmChart, cClsId, cRegQuery, nWhich, oStatus

******* Проверка возможности работать в системе ******************************************

IF M_KodAdmAppls = 0  // Выйти из системы если нет авторизации
   LB_Warning("Вы не авторизовались в системе и не можете ей пользоваться!")
   RETURN NIL
ENDIF
IF ApplChange()       // Перейти в папку выбранного приложения или выйти из системы
   LB_Warning("Необходимо задать (выбрать) хотя бы одно текущее приложение !!!")
   RETURN NIL
ENDIF

IF .NOT. FILE("Abs.dbf")          // Нет БД Abs.dbf
   LB_Warning("В текущем приложении нет БД Abs.dbf. Необходимо ее создать в 3-й подсистеме !!!")
ENDIF

******* Подготовка данных (расчет частотного распределения абсолютых частот) *************

CLOSE ALL
USE ABS EXCLUSIVE NEW
SELECT ABS
N_Rec = RECCOUNT()
N_Col = FCOUNT()

Mess = '3.7.1. Подготовка данных для визуализации частотного распределения абс.частот'
@ 4,5 DCPROGRESS oProgress SIZE 95,1.1 MAXCOUNT 3*(N_Rec-2) COLOR GRA_CLR_BLUE PERCENT EVERY 100
DCREAD GUI TITLE Mess PARENT @oDialog FIT EXIT
oDialog:show()
nMax  = N_Rec
nTime = 0

mMinX = 0
mMaxX = 0
DC_GetProgress(oProgress,0,nMax)
FOR i=1 TO N_Rec-2
    DBGOTO(i)
    FOR j=1 TO N_Col-3
        Fv = FIELDGET(2+j)
        mMinX = MIN(mMinX, Fv)
        mMaxX = MAX(mMaxX, Fv)
    NEXT
    DC_GetProgress(oProgress, ++nTime, nMax)
NEXT

PRIVATE aData[mMaxX]
PRIVATE aLabelText[mMaxX]
AFILL(aData,0)
AFILL(aLabelText,' ')

mMinY = 0
mMaxY = 0
FOR i=1 TO N_Rec-2
    DBGOTO(i)
    FOR j=1 TO N_Col-3
        Fv = FIELDGET(2+j)
        IF Fv > 0
           aData[Fv] = aData[Fv] + 1
           aLabelText[Fv] = ALLTRIM(STR(Fv))
           mMinY = MIN(mMinY, aData[Fv])
           mMaxY = MAX(mMaxY, aData[Fv])
        ENDIF
    NEXT
    DC_GetProgress(oProgress, ++nTime, nMax)
NEXT

DC_GetProgress(oProgress,nMax,nMax)
oDialog:Destroy()

***** ВИЗУАЛИЗАЦИЯ ГРАФИКА *************************************************************

***** Размер окна для отображения графика **********************************************

* --- RMChart ActiveX Control --
@ 0,0 DCRMCHART oRmChart SIZE 1140, 640 RESIZE DCGUI_RESIZE_RESIZEONLY

***** Колонки и линейный график: исходные данные ***************************************

DcAddLineGroup TO aLineGroupIndus ;
        DATA aData ;
        WHICHDATAAXIS 2 ;
        STYLE RMC_LINE_CABLE ;
        COLOR Green ;
        LINESTYLE RMC_LSTYLE_LINE ;
        SYMBOLSTYLE RMC_SYMBOL_BULLET ;
        VALUELABEL 1

****************************************************************************************
DcAddDataAxis TO aDataAxis6 ;
        AXISTEXT "Частота встреч фактов"  ;
        ALIGN RMC_XAXISBOTTOM  ;
        MINVALUE mMinX MAXVALUE mMaxX

DcAddDataAxis TO aDataAxis6 ;
        AXISTEXT "Количество встреч частоты фактов"  ;
        ALIGN RMC_DATAAXISLEFT  ;
        MINVALUE mMinY MAXVALUE mMaxY

@ 10,10 DcChartRegion oRegion6 ;                         // Координаты нижнего левого угла поля построения графика в окне
        PARENT oRMChart ;
        SIZE 1100, 600 PIXEL ;      // Размер поля построения графика в окне
        CAPTION TITLE M_NameAppl BACKCOLOR Coral TEXTCOLOR FloralWhite FONTSIZE 10 BOLD ;
        GRID ;
        DATAAXIS aDataAxis6 ;
        LABELAXIS LABELARRAY aLabelText ALIGN RMC_LABELAXISBOTTOM ;
        LINEGROUP aLineGroupIndus
****************************************************************************************

***** Кнопки визу **********************************************************************

@ 620,0                     DCPUSHBUTTON CAPTION 'Запись графического файла'  SIZE 200,25 ;
                            ACTION {||SaveChartToBitmap(oRMChart)}

@ DCGUI_ROW, DCGUI_COL + 10 DCPUSHBUTTON CAPTION 'Копирование в буфер обмена' SIZE 170,25 ;
                            ACTION {||SaveChartToClipboard(oRMChart)}

@ DCGUI_ROW, DCGUI_COL + 10 DCPUSHBUTTON CAPTION 'Печать'                     SIZE  50,25 ;
                            ACTION {||PrintChart(oRMChart)}

@ DCGUI_ROW, DCGUI_COL + 10 DCPUSHBUTTON CAPTION 'Удаление артефактов'        SIZE 150,25 ;
                            ACTION {||Razrab()}

DCGETOPTIONS RESIZE PIXEL

DCREAD GUI ;
    SETAPPWINDOW ;
    FIT ;
    TITLE '3.7.1. Частотное распределение абсолютных частот по Abs.dbf.   (C) Универсальная когнитивная аналитическая система "Эйдос-Х++"' ;
    OPTIONS GetOptions ;
    EVAL {||oRMChart:RMCToolTipWidth := 100, ;
            oRMChart:RMCUserWatermark := '(C) Универсальная когнитивная аналитическая система "Эйдос-Х++"', ;
            oRMChart:RMCUserWMAlignment := RMC_TEXTRIGHT, ;
            oRMChart:RMCUserWMFontSize := 20, ;
            oRMChart:RMCUserWMLucent := 40, ;
            oRmChart:mouseDown := ;
            {|a,b,c,d,e,o|aData := e,nWhich := a,o:=Thread():new(),o:start({||BrowseCallbackData(nWhich,aData,oRMChart)})}, ;
            oRmChart:mouseMove := ;
            {|nMouseButton,b,nX,nY,aData|oRMChart:showToolTip( nMouseButton, nX, nY, aData )}, ;
            oRmChart:draw(), ;
            ShowDebugInfo(oRMChart)}
CLOSE ALL

RETURN NIL

*************************************************************************************************
[/size]
Last edited by Eugene Lutsenko on Sun Mar 10, 2013 11:14 pm, edited 4 times in total.

User avatar
hz_scotty
Posts: 107
Joined: Thu Jan 28, 2010 8:20 am
Location: Wr.Neustadt / Österreich

Re: Work with graphic library rmchart

#9 Post by hz_scotty »

Hi!

Can you please send the structure from the "ABS.DBF" or some Testdata! ;)

a Sample Testprogram is welcome :dance:

great job :clap:
best regards
Hans

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: Work with graphic library rmchart

#10 Post by Eugene Lutsenko »

I lowered buttons and changed the picture and the program text in the previous message. Link to file with which this module works: http://lc.kubagro.ru/Dima/Abs.DBF

Post Reply