Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Mon Nov 20, 2017 12:51 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu Mar 24, 2011 1:25 pm 
Offline
User avatar

Joined: Wed Feb 02, 2011 9:20 am
Posts: 20
I am developing a new program and using Plot Trace V2 to draw curves. I would like to make some of the line widths wider on some of the plots but I cannot seem to find a way to do this. I do have an older program that was developed within Qlarity and it does have a linewidth property within Plot Trace V2 but I do not have that property in Qlarity version 2.63. Did this property get removed? How can I do this?


Top
 Profile  
 
PostPosted: Thu Mar 24, 2011 2:15 pm 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
Does that other workspace have a Template copy of the PlotTraceV2? You may just need to create a template copy and copy the code into your new workspace. I remember giving some code out to add that type of functionality, but it was not tested, so it wouldn't have been put in the library.

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
PostPosted: Thu Jun 09, 2011 3:29 pm 
Offline
User avatar

Joined: Wed Feb 02, 2011 9:20 am
Posts: 20
Thanks. I figured it out.

In Qlarity with your project open go to

Edit

Edit Libraries

Add Existing Library

Add Other Library

Go to directory in which QSI was installed

Select “all files”

Find core.qlib.qhide and add it.

Close this screen



Edit

Add/edit templates

New template

Copy code of an existing template in a library

Select corePathtrace

Close



Switch to Code view

Find templates in “Object Tree”

Copy code from modified to this template


Top
 Profile  
 
PostPosted: Thu Jun 16, 2011 11:39 pm 
Offline

Joined: Wed Jun 15, 2011 12:14 am
Posts: 28
I've just done what you said... but after that What is the property or field that you changed ?
I am searching for borderline but it doesn't appear.
What field or fields did you changed ?


Top
 Profile  
 
PostPosted: Mon Jun 20, 2011 8:41 am 
Offline
User avatar

Joined: Thu Mar 02, 2006 2:12 pm
Posts: 487
Location: Salt Lake City, Utah
The PlotTraceV2 object doesn't have a LineWidth property. You can make a template copy of the "CorePathTrace" object and possibly add that functionality. First add the library "core.qlib.qhide" to your workspace. Make a template copy of "CorePathTrace".

Add this code to the template:

Code:
dim lineWidth as integer
init lineWidth := 1


Change the draw function code in the template:

Code:
func Draw()
     handles MSG_DRAW

     dim i, i2, max as integer
     dim j, k as integer
     dim old_ypts[], old_xpts[] as integer
     dim ypts2[], xpts2[] as integer

     setbgcolor (_colorMap[bgcolor])
     settransparent(_colorMap[bgcolor])
     usetransparent (transparent)

     drawBorder (xpos, ypos, xpos+width-1, ypos+height-1, _styleMap[borderstyle], BDR_FILL)

     if showLines then
         if fastDraw then
             Setfgcolor(_colorMap[Tracecolor1])
             DrawPolygon (left(xpts, insertIdx), left(ypts, insertIdx), POLY_NOCONNECT)
             old_ypts := ypts
             old_xpts := xpts
             for j = 2 to lineWidth
                if j mod 2 == 0 then
                    for k = 0 to len(ypts)-1
                        ypts[k] := ypts[k] + 1
                    next
                else
                    for k = 0 to len(xpts)-1
                        xpts[k] := xpts[k] + 1
                    next
                endif
                DrawPolygon (left(xpts, insertIdx), left(ypts, insertIdx), POLY_NOCONNECT)
             next
             ypts := old_ypts
             xpts := old_xpts
         else
             old_ypts := ypts
             old_xpts := xpts
             xpts2 := xpts
             ypts2 := ypts
             for j = 1 to lineWidth
                 max = insertIdx-1
                 for i = 1 to max
                     i2 := i-1
                     SetFgColor (clrs[max-i2])
                     DrawLine (xpts[i], ypts[i], xpts[i2], ypts[i2])
                     if linewidth > 1 then
                        DrawLine (xpts2[i], ypts2[i], xpts2[i2], ypts2[i2])
                        DrawLine (xpts2[i], ypts[i], xpts2[i2], ypts[i2])
                        DrawLine (xpts[i], ypts2[i], xpts[i2], ypts2[i2])
                    endif
                 next
                if j mod 2 == 0 then
                    for k = 0 to len(ypts)-1
                        ypts[k] := ypts[k] + 1
                        ypts2[k] := ypts2[k] - 1
                    next
                else
                    for k = 0 to len(xpts)-1
                       xpts[k] := xpts[k] + 1
                        xpts2[k] := xpts2[k] - 1
                    next
                endif
             next
             ypts := old_ypts
             xpts := old_xpts
         endif
    else
        max := insertIdx-1
    endif

     if showPointMarker then
         SetFgColor (_colorMap[curPosColor])
         for i = 0 to max
             DrawBox (xPts[i]-1, yPts[i]-1, xPts[i]+1, yPts[i]+1)
         next
     endif

     if showCurPos then
         SetFgColor (_colorMap[curPosColor])
         if insertIdx > 0 then
             i := insertIdx-1
             DrawBox (xPts[i]-1, yPts[i]-1, xPts[i]+1, yPts[i]+1)
         endif
     endif
endfunc

_________________
Ron L.

http://www.beijerelectronicsinc.com/


Top
 Profile  
 
PostPosted: Mon Jun 20, 2011 9:19 am 
Offline

Joined: Wed Jun 15, 2011 12:14 am
Posts: 28
Thanks a lot, your solution is so good and the final result is perfect. I am thankful


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group