2016년 12월 27일 화요일

How to store procedure in tinyDB?


At first I want to thank you all for helping me to understand coding.
With your help I made a very useful and cool app, for a company I'm working in.

Here is the machine I made. As you can see from the picture, it uses a touch screen
to controll the movements of those two cylindres at the front. I made the excactly the
same app in ai2. And it works very good so far. The appis there simply to record those
movements from cylindres and store them for later use. So the operater can just replay
operations in every day use.



















I simply made a procedure to store those values, and to play them back.

But here is the major problem. When machine turns off, all the data will be lost.

And I seek for some help online, and the best solution for this is tiny database.

I'm wondering is it possible to store procedure in tinyDB ?
 
My procedure looks like this: 



Basically it stores 2 values in arrangment to record user's inputs.
For ex. user inputs values, and saves them, so later he can playback those values.
Just like he would do on a simple piano keyboard recorder, where you can play some
notes, record them and later play them back.

I already made a save button, where operater can store operation and name it for later use. 

Anybody know how to do this. Maybe help me a little bit.

Here is aia of my code, so anyone who want to improve this, or
maybe want to learn something is free to use this code :D

http://www14.zippyshare.com/v/cR85ZoGF/file.html

--
Congrats on your work / app.

You'll have to provide a save functionality that gets the data from your your variables and then store them either as single key / value (TinyDB tag / value) or as list.
Then you also have to provide ability to retrieve those data either when the app starts (Screen1.Initialize).

-- 
It looks like you can save the lists times and notes (StoreValue) under two tag names in TinyDB.
When the app opens, you can retrieve (GetValue) the tag values into the times and notes lists before calling the pustiFalc1 procedure.
The question is how does the user change the contents of the times and notes lists before saving those changes in TinyDB.
Also, I don't know what the save1.Click block is saving ie. the Falc(n)Updown.Visible blocks are for what?

-- 
The user change contents of times and notes lists simply by pressing the buttons (if you have extra 2 minutes please download app from the link i provided above).
The block save1.Click is just saving a name of recording, so the user will know which one to replay later.
And Falc(n)Updown.Visible blocks are changing simply because there are 8 of them, and when I call one of them I need rest of all to disappear.
I simply made 8 completly similar things in order to create 8 recordings. I know that there is a better way to make this, but I'm mechanical engineer not a programmer.

It's a bit more complicated than it looks. I'm able to store notes, times and count in tiny db, but after that I'm not able to call them back in order to replay what I recorded.

Any other ideas?

Scott thank you for your time and efford. I really appreciate it. 

-- 
I think that you should study how TinyDB works with one of my example projects.
That would be easier than me having to try to understand how your app works and to debug it.
Then if you have a specific question regarding some TinyDB blocks that are not working correctly, you could come back here.
Try searching for other Youtube tutorials which use TinyDB.
Also see this chapter on databases which introduces TinyDB.

-- 

댓글 없음:

댓글 쓰기