<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pl-pl">
<link rel="self" type="application/atom+xml" href="https://forum.atnel.pl/feed.php?f=63&amp;t=18868&amp;mode" />

<title>ATNEL tech-forum</title>
<link href="https://forum.atnel.pl/index.php" />
<updated>2017-07-25T21:07:49+01:00</updated>

<author><name><![CDATA[ATNEL tech-forum]]></name></author>
<id>https://forum.atnel.pl/feed.php?f=63&amp;t=18868&amp;mode</id>
<entry>
<author><name><![CDATA[Zealota]]></name></author>
<updated>2017-07-25T21:07:49+01:00</updated>
<published>2017-07-25T21:07:49+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=18868&amp;p=192592#p192592</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=18868&amp;p=192592#p192592"/>
<title type="html"><![CDATA[Re: B4A Wykres]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=18868&amp;p=192592#p192592"><![CDATA[
Brawo!<br />Widzę, że Kolega z tymi &quot;drobnostkami&quot; mocno się rozpędza, tak trzymać <img src="https://forum.atnel.pl/images/smilies/icon_e_smile.gif" alt=":)" title="Szczęśliwy" /><p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=16487">Zealota</a> — 25 lip 2017, o 21:07</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Wojtek Apel]]></name></author>
<updated>2017-07-23T21:33:32+01:00</updated>
<published>2017-07-23T21:33:32+01:00</published>
<id>https://forum.atnel.pl/viewtopic.php?t=18868&amp;p=192496#p192496</id>
<link href="https://forum.atnel.pl/viewtopic.php?t=18868&amp;p=192496#p192496"/>
<title type="html"><![CDATA[B4A Wykres]]></title>

<content type="html" xml:base="https://forum.atnel.pl/viewtopic.php?t=18868&amp;p=192496#p192496"><![CDATA[
Czołem!<br /><br />Wpadł pomysł, żeby do mojego wskaźnika napięcia akumulatora, dołożyć wykres, który malowałby zmiany napięcia i który można by przesuwać paluchem po ekranie tak, żeby możliwe było cofanie do wcześniejszych odczytów.<br />Po pierwszych próbach wygląda to tak. <br /><br /><div style="width: 583px; height: 471px; margin: 0 auto; padding-left: 26px; padding-top: 48px; background: url('https://www.atnel.pl/download/atnel_tv.png') no-repeat;"> <strong>iframe</strong> </div><br /><br /><br />[syntax=basic4gl]Sub Globals<br />'These global variables will be redeclared each time the activity is created.<br />'These variables can only be accessed from this module.<br />    Dim siatka As Bitmap<br />Dim marg As Bitmap<br />Dim wykres_canvas As Canvas<br />Dim wykres_rect As Rect<br /><br />Dim list As List<br /><br />Dim tt As Double<br />Dim py As Double<br />Dim ky As Double<br />Dim tx As Double<br />Dim mx As Double<br />Dim mx_up As Double<br />Dim txx As Double<br />Dim sht As Double<br /><br /><br /><br />Private Panel1 As Panel<br />Private Label2 As Label<br />Private Label1 As Label<br /><br /><br />Private Label3 As Label<br />Private Label4 As Label<br />Private Label5 As Label<br />End Sub<br /><br />Sub Activity_Create(FirstTime As Boolean)<br />'Do not forget to load the layout file created with the visual designer. For example:<br /><br />Activity.LoadLayout(&quot;wykres&quot;)<br />Activity.Title=&quot;Wykres mbDroid&quot;<br />    <br />Label1.Text=&quot;..&quot;<br />Label2.Text=&quot;..&quot;<br /><br />wykres_canvas.Initialize(Panel1)<br />siatka.Initialize(File.DirAssets, &quot;tabela_alfa.bmp&quot;)<br />marg.Initialize(File.DirAssets, &quot;tabela_marg.bmp&quot;)<br />wykres_rect.Initialize(0%x, 0%y, 100%x, 100%y)<br />wykres_canvas.DrawBitmap(siatka, Null, wykres_rect)<br /><br /><br /><br />list.Initialize<br />list.Clear<br /><br /><br />list = File.ReadList(File.DirAssets, &quot;pomiary.txt&quot;)<br /><br />Label3.Text = list.size<br /><br /><br />For tt = 0 To list.Size -2<br />    <br />If tt &lt; list.Size - 1 Then<br />      <br />  If IsNumber(list.Get(tt)) Then<br />  py = list.Get(tt)<br />  End If<br />  If IsNumber(list.Get(tt+1)) Then<br />  ky = list.Get(tt+1)<br />  End If<br />  <br />End If<br />txx = tx+30<br />    wykres_canvas.DrawLine(tx, py, txx , ky, Colors.Red, 7)<br />wykres_canvas.DrawBitmap(marg, Null,wykres_rect)<br />tx = txx <br />   Activity.Invalidate<br />Label2.Text = tx<br />Next<br />End Sub<br /><br />Sub Activity_Resume<br /><br />End Sub<br /><br />Sub Activity_Pause (UserClosed As Boolean)<br /><br />End Sub<br /><br /><br /><br />Sub Activity_Touch (Action As Int, X As Float, Y As Float)<br /><br /><br />Select Action<br /><br />Case Activity.ACTION_DOWN  <br />mx = X<br />Label1.Text = mx<br /><br />Case Activity.ACTION_MOVE <br />sht = (X - mx) + mx_up<br />py = 730<br /><br /> <br />wykres_canvas.DrawRect(wykres_rect, Colors.White, True , 5dip)<br />wykres_canvas.DrawBitmap(siatka, Null,wykres_rect)<br />tx = 150 + sht<br />For tt = 0 To list.Size -2<br />    <br />If tt &lt; list.Size - 1 Then<br />      <br />  If IsNumber(list.Get(tt)) Then<br />  py = list.Get(tt)<br />  End If<br />  If IsNumber(list.Get(tt+1)) Then<br />  ky = list.Get(tt+1)<br />  End If<br />  <br />End If<br />txx = tx+30<br />    wykres_canvas.DrawLine(tx, py, txx , ky, Colors.Red, 7)<br />tx = txx <br />    Activity.Invalidate<br />Next<br />wykres_canvas.DrawBitmap(marg, Null, wykres_rect)<br />Label2.Text = Floor(sht)    <br />    <br />    <br />Case Activity.ACTION_UP<br />mx_up = sht<br /><br />End Select<br />End Sub[/syntax]<p>Statystyki: Napisane przez <a href="https://forum.atnel.pl/memberlist.php?mode=viewprofile&amp;u=15298">Wojtek Apel</a> — 23 lip 2017, o 21:33</p><hr />
]]></content>
</entry>
</feed>