Announcement

Collapse
No announcement yet.

need Help !!! in Graphics....

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Paul Dixon
    replied
    Stefan,
    it's not clear what you're after. Do you just want PB code to draw these sorts of things on a PC display or are you after code to communicate with an external flat panel/touch screen?

    For the first case, PB/DOS has LINE and CIRCLE commands to draw such thing eg as below.

    Paul.
    Code:
    DegToRad!=3.14159/180
    
    
    rem a graphic screen
    screen 12
    
    rem centre point and size of compass
    xc%=400
    yc%=400
    r%=60
    
    rem Draw the compass
    circle (xc%,yc%),r%
    
    
    oldEndlinex%=0.9*r%*sin(0)
    oldEndliney%=0.9*r%*cos(0)
    
    'draw/move the pointer
    for angle% = 0 to 359 step 5
    color 0,0
    line (xc%,yc%) - step (oldEndlinex%,oldEndliney%)
    
    endlinex% = 0.9*r%*sin(DegToRad! * angle%)
    endliney% = 0.9*r%*cos(DegToRad! * angle%)
    
    color 2,0
    line (xc%,yc%) - step (endlinex%,endliney%)
    
    delay 0.05
    oldEndlinex%=endlinex%
    oldEndliney%=endliney%
    
    next
    
    skip:
    
    rem a bargraph/speedometer
    wide% =  50
    long% = 100
    xc%=50
    yc%=400
    
    for c% = 1 to 10
    
    for l%= 0 to long% step 5
    
    length%=long% * sin(DegToRad! * 180*l%/long%)
    line (xc%,yc%) - (xc%+length%,yc%+wide%),3,BF
    
    line (xc%+length%,yc%) - (xc%+long%,yc%+wide%),0,BF
    
    delay 0.05
    
    next
    next

    Leave a comment:


  • Stefan Koenig
    Guest replied
    Sorry, i forgot some Issues:

    Oil-Pressure and Heading (will be fitted separatly)
    in follow format :
    ,Oil in >Integer< shown as "Light-Symbol"

    and on Com 3 Heading Data`s,
    where format is:
    %HHH,L - where -

    HHH is the Heading degree in >Integer<
    L is Signal Strength as >Byte<


    ------------------

    Leave a comment:


  • Stefan Koenig
    Guest started a topic need Help !!! in Graphics....

    need Help !!! in Graphics....

    I started with a gigantic Project.
    I like to Build a complete Digital Dashboard for my Van.
    even all Original Instruments should be exchanged with a Display.

    There should be in Future just 2 Display`s in the Car...
    for all Drive necessary`s a(6,4" TFT) Backlighted and
    Dashboard- mounted and for Backwards Driving a Roof-Mounted
    one (also 6,4" TFT)

    it will maybe later fitted with Touchscreen to remove also
    the Switches for Lights, Wiper and so on....
    I using Industrial -PC`s with an AMD- K6 266 MHz and
    have 4 Serial Ports for Communications.


    in the Past i done some Programming in TurboBasic wich i can use
    now - what makes it a little Easier for Build.

    my Problem is now:
    i like to Integrate 2 "Analog" Instruments Graphically, but i have
    absolutely no Idea and know How to realize it.
    The instruments should be a Speedometer and a Compass beside,
    where the Speedometer should be start at left Bottom
    and ends in right top of Display
    The Compass should be on right bottom

    The Speedometer will come on COM1 with 9600 Baud

    The Data`s who are comes in are in follow Format:
    Protocoll:
    %SOG,GRS,DW,PRS,FLT,LIG,HEA,WIP,TEMP,FL
    what will be used at follow:

    SOG = Speed over Ground >INTEGER< visible as Speedo in KM/h
    GRS = Gyro move forwards >INTEGER< visible as an Arrow app. 1cm
    DW = Driven Way in Km >INTEGER< visible as "normal" KM area
    PRS = Pressure of Air >INTEGER< visible as an integrated instrument
    FLT = Air- Filter exchg. >INTEGER< visible as an Percent Bar
    LIG = Light on/off >Byte< is just a highlighted Bar
    HEA = Fan on/off >Byte< is just a highlighted Bar
    Wip = Wiper on/off >Byte< is just a highlighted Bar
    TEMP= Temperature >Integer< visible as percent Bar
    FL = Fuel in Liter >Integer< visible ans an integrate instrument

    ------------------------------------------------
    All this Data must be Integrated in the Dashboard Screen...

    The Data`s are Basic NMEA Data`s and comes to Serial port COM2

    the Complete Graphics is not extreme Time Critical, while the
    internal Physically Organisation of the Rest
    will be made with a seperate PC. (same system)

    in the Past i don`t do graphically Programming.
    while i am searching i did not found some usable samples
    for the graphical indicator`s. i.eg. for Compass....

    ( or maybe not able to use them while they not described)
    I.M.H.O.


    I using Powerbasic for DOS version 3.20

    is anyone here, who can help me with some sample Codes or help
    by coding ????
    The use of Data`s will be no Problem,
    only the Graphics. is my Problem .....


    Thanks ind Advance for Help at this Project
    for sample-Picture how i like to visible mailto:
    [email protected]


    ------------------
Working...
X