Hi All
I want to make like HMI device on raspbery pi 2 also write code B4J and copy java 1.8.0 download b4j-bridge.jar all ok
but my code work all pc notebook and netbook (windows xp,windows 7 and windows 8) didnt work raspbery pi
this code sample gauge trying...
I tried some way
a-) via bridge LTX terminal write program start and give error about 10 secons and RB lock
b-) copy jar file RB downloads folder and on LTC terminan
about 10seconds give error and RB lock
c-) I tried Similey.jar ( example code from Erel) a and b method it is work on RB but RB like a lock mouse work , keyboard not work I want stop program I am cut power..
I didnt know what is the wrong ? I tried this about one week no any solition.
do you have any idea ?
(termination of my project had little time)
on PC screenshot
I want to make like HMI device on raspbery pi 2 also write code B4J and copy java 1.8.0 download b4j-bridge.jar all ok
but my code work all pc notebook and netbook (windows xp,windows 7 and windows 8) didnt work raspbery pi
this code sample gauge trying...
B4X:
#Region Project Attributes
#MainFormWidth: 300
#MainFormHeight: 400
#End Region
Sub Process_Globals
Private fx As JFX
Dim aci As Short=0
Private MainForm As Form
Dim csvGauge, csvNeedle As Canvas
Dim bmpGauge, bmpNeedle As Image
Dim imvGauge, imvNeedle As ImageView
'Dim SRectGauge, DRectGauge, SRectNeedle, DRectNeedle As Rect
Private ImageView1 As ImageView
Private Button1 As Button
Private Label1 As Label
Private lbl2 As Label
Private Slider1 As Slider
Private my_font As Font
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.SetFormStyle("UNIFIED")
MainForm.RootPane.LoadLayout("ekran1") 'Load the layout file.
MainForm.Resizable=False
MainForm.BackColor=fx.Colors.Blue
MainForm.Show
MainForm.Title="Gauge Test Ahmet UCAN"
csvGauge.Initialize("cvs")
csvNeedle.Initialize("csv")
lbl2.Initialize("")
bmpGauge=fx.LoadImage(File.DirAssets,"led_base.png")
bmpNeedle=fx.LoadImage(File.DirAssets,"led_nedle.png")
Dim w,h As Double
w=bmpGauge.Width '+ 100
h=bmpGauge.Height'+100
MainForm.RootPane.AddNode(csvGauge, 10, 10, w,h)
MainForm.RootPane.AddNode(csvNeedle, 10, 10, bmpNeedle.Width,bmpNeedle.Height)
MainForm.RootPane.AddNode(lbl2,120,180,100,50)
csvGauge.DrawImage(bmpGauge,0dip,0dip,w,h)
aci=0
move_needle(0)
Label1.Text="0"
lbl2.Alpha=1
lbl2.TextColor=fx.Colors.Red
lbl2.Font=fx.CreateFont("",22,True,False)
lbl2.Text="---"
End Sub
Sub Button1_Action
'Dim x,y As Double
Dim deg As Short
If aci < 180 Then
aci=aci + 1
Else
aci=0
End If
deg=(-90)+ aci
move_needle(deg)
End Sub
Sub slider1_ValueChange (Value As Double)
Dim a,n As Int
n=Value
a=(-90)+n
move_needle(a)
lbl2.Text=n
End Sub
Sub move_needle(teta As Short)
Dim x,y As Double
x=Abs(csvGauge.Width - csvNeedle.Width)/2
y=Abs(csvGauge.Height - csvNeedle.Height)/2
csvNeedle.ClearRect(x,y,bmpNeedle.Width,bmpNeedle.Height)
Label1.Text=teta
csvNeedle.DrawImageRotated(bmpNeedle,x,y,bmpNeedle.Width,bmpNeedle.Height,teta)
End Sub
I tried some way
a-) via bridge LTX terminal write program start and give error about 10 secons and RB lock
b-) copy jar file RB downloads folder and on LTC terminan
B4X:
pi@ta1dr $ cd Downloads
pi@ta1dr /Downloads $ java -jar gauge.jar
program start
about 10seconds give error and RB lock
c-) I tried Similey.jar ( example code from Erel) a and b method it is work on RB but RB like a lock mouse work , keyboard not work I want stop program I am cut power..
I didnt know what is the wrong ? I tried this about one week no any solition.
do you have any idea ?
(termination of my project had little time)
on PC screenshot