Home › Forums › HTBasic Forum › Stripchart Widget Issues
- This topic has 1 reply, 2 voices, and was last updated 5 years, 11 months ago by ZeRider.
-
AuthorPosts
-
October 8, 2018 at 4:44 pm #1307
Basing an application that needs the Stripchart Scrolling option e.g. sarting with the following code from examples supplied.
The scroll bar is drawn, nut does not appeqear to update and respond to user input.
Also following that is the Stripchart Rescale example, slightly modified. In Y-axis Logarithmic display, Autoscale does not work,
Appreciate it if you could look into this.! **************************************************
! Example: STRIPCHART (Scrolling)
! This program builds a scrolling STRIPCHART widget
! that displays the values of ten digits.
! **************************************************INTEGER I
DIM Vals(1:16)
ASSIGN @Strip TO WIDGET “STRIPCHART”
CONTROL @Strip;SET (“TITLE”:” Example: STRIPCHART (Scrolling)”)
CONTROL @Strip;SET (“SYSTEM MENU”:”Quit”)
CONTROL @Strip;SET (“VISIBLE”:0,”SHARED X”:1)
CONTROL @Strip;SET (“X”:50,”Y”:25,”WIDTH”:400,”HEIGHT”:325)
CONTROL @Strip;SET (“TRACE COUNT”:10,”CURRENT TRACE”:0)
CONTROL @Strip;SET (“POINT CAPACITY”:10000)
CONTROL @Strip;SET (“CURRENT AXIS”:”X”,”ORIGIN”:0,”RANGE”:50)
CONTROL @Strip;SET (“DIGITS”:11,”NUMBER FORMAT”:”FIXED”,”USER SCROLL”:1)
CONTROL @Strip;SET (“CURRENT AXIS”:”Y”,”ORIGIN”:-.5,”RANGE”:10)
ON EVENT @Strip,”SYSTEM MENU” GOTO Finis
FOR I=1 TO 10
Vals(I)=(I-5)*.05
CONTROL @Strip;SET (“CURRENT TRACE”:I,”TRACE LABEL”:”DIGIT “&VAL$(I-1))
NEXT I
CONTROL @Strip;SET (“VISIBLE”:1)
ON EVENT @Strip,”SCROLLED” GOSUB Evnt
FOR A=0 TO 1000000
WAIT .1
CONTROL @Strip;SET (“POINT LOCATION”:A,”VALUES”:Vals(*))
Vals(1)=Vals(1)+1
I=1
WHILE Vals(I)>9.5
Vals(I)=Vals(I)-10
I=I+1
Vals(I)=Vals(I)+1
END WHILE
NEXT A
Evnt: RETURNFinis:!
ASSIGN @Strip TO * ! Delete STRIPCHART widget
END! *********************************************************
! Example: STRIPCHART (Rescale)
! This program builds a STRIPCHART widget. As the chart
! scrolls, the vertical scale factor automatically changes
! to accomodate the display values.! *********************************************************
LOAD BIN “BPLUS”
INTEGER I
REAL D(1:2)
ASSIGN @Graph TO WIDGET “STRIPCHART”
CONTROL @Graph;SET (“TITLE”:”Example: STRIPCHART (Rescale)”)
CONTROL @Graph;SET (“X”:50,”Y”:25,”VISIBLE”:0)
CONTROL @Graph;SET (“CURRENT AXIS”:”X”,”ORIGIN”:0,”RANGE”:4)
CONTROL @Graph;SET (“NUMBER FORMAT”:”MINUTES”,”DIGITS”:9)
CONTROL @Graph;SET (“CURRENT AXIS”:”Y”,”LOGARITHMIC”:1,”ORIGIN”:.01)
CONTROL @Graph;SET (“RANGE”:4,”AUTOSCALE”:1,”VISIBLE”:1)
CONTROL @Graph;SET (“SYSTEM MENU”:”Quit”)
ON EVENT @Graph,”SYSTEM MENU” GOTO Finis
T=0
WHILE 1
T=T+.1
FOR I=1 TO 2
D(I)=(T^2+EXP((-62+25*I+10*SIN(T*I*3)+T*(I-2.5))/12))
NEXT I
WAIT .05
CONTROL @Graph;SET (“POINT LOCATION”:T,”VALUES”:D(*))
END WHILE
Finis:!
ASSIGN @Graph TO * ! Delete STRIPCHART widget
ENDOctober 24, 2018 at 2:52 pm #1316In the second example, if you change ”LOGARITHMIC”:1 by ”LOGARITHMIC”:0
I think it’s working. -
AuthorPosts
- You must be logged in to reply to this topic.