Advise on a idea

Post your Gambas programming questions here.
AndyGable
Posts: 106
Joined: Wednesday 02nd December 2020 12:11am
Location: England
Contact:

Advise on a idea

Post by AndyGable » Wednesday 21st July 2021 10:15pm

Hi Everyone,

I was hoping I could get some advise on a idea that I am thinking about

This is what I have at the moment a small
Application written in Gambas that connects to a central MySQL server and pulls down all data from that server to a local MySQL server (this may change if I can find a low memory database that works with Gambas)

The sync app starts full screen but once it has done the first sync (get all data etc) from the server is there a way to switch it to a screenless app in the background?

I know if I start the app like

./home/algpos/dbsyc/dbsync.gambas && the app will run in the background but I need it to be in the only app that has focus until it has completed its work.

Is it possible to switch apps between main and background work?

User avatar
BruceSteers
Posts: 577
Joined: Thursday 23rd July 2020 5:20pm

Re: Advise on a idea

Post by BruceSteers » Wednesday 21st July 2021 11:40pm

it may not retain focus but you can set Form.TopOnly = True or False and Form.Stacking = Window.Above or Window.Normal
that will keep your window above all the others and you can unset the flags when it's done
Wishing well
Bruce

If at first you don't succeed , try it differently.

User avatar
BruceSteers
Posts: 577
Joined: Thursday 23rd July 2020 5:20pm

Re: Advise on a idea

Post by BruceSteers » Wednesday 21st July 2021 11:41pm

if you want your app to talk to other gambas apps of yours then look into DBus
Wishing well
Bruce

If at first you don't succeed , try it differently.

AndyGable
Posts: 106
Joined: Wednesday 02nd December 2020 12:11am
Location: England
Contact:

Re: Advise on a idea

Post by AndyGable » Thursday 22nd July 2021 1:06am

I'm using pipe to talk between the apps

User avatar
BruceSteers
Posts: 577
Joined: Thursday 23rd July 2020 5:20pm

Re: Advise on a idea

Post by BruceSteers » Thursday 22nd July 2021 7:12am

AndyGable wrote:
Thursday 22nd July 2021 1:06am
I'm using pipe to talk between the apps
cool then your main app could disable the other apps while it's working then release them when it's done it's business
Wishing well
Bruce

If at first you don't succeed , try it differently.

User avatar
PJBlack
Posts: 156
Joined: Tuesday 09th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

Re: Advise on a idea

Post by PJBlack » Thursday 22nd July 2021 9:34am

i honestly don't understand the intention behind your question ...

is it about computation time? then have a look at the command nice (i have seen functional somewhere in gambas too)

and an application that compares the data ... uh yes ... if you have two mysql servers running anyway (i hope you mean mariadb) have a look at the terms replication, and/or cluster and let the one who can do it best do the work ...
if you need something small on the client side you could also use sqlite and mariadb/mysql on the server ... also with this the replication works


Translated with www.DeepL.com/Translator

User avatar
BruceSteers
Posts: 577
Joined: Thursday 23rd July 2020 5:20pm

Re: Advise on a idea

Post by BruceSteers » Thursday 22nd July 2021 12:07pm

I think i may have misread the question, you kinda lost me a bit at SQL..

How about something like...
FMain.FullScreen = True

' do your routines..

' when finished

FMain.FullScreen = False

Wishing well
Bruce

If at first you don't succeed , try it differently.

AndyGable
Posts: 106
Joined: Wednesday 02nd December 2020 12:11am
Location: England
Contact:

Re: Advise on a idea

Post by AndyGable » Thursday 22nd July 2021 12:23pm

BruceSteers wrote:
Thursday 22nd July 2021 12:07pm
I think i may have misread the question, you kinda lost me a bit at SQL..

How about something like...
FMain.FullScreen = True

' do your routines..

' when finished

FMain.FullScreen = False

That does not put the application into the background that only makes the app screenless.

AndyGable
Posts: 106
Joined: Wednesday 02nd December 2020 12:11am
Location: England
Contact:

Re: Advise on a idea

Post by AndyGable » Thursday 22nd July 2021 12:26pm

PJBlack wrote:
Thursday 22nd July 2021 9:34am
i honestly don't understand the intention behind your question ...

is it about computation time? then have a look at the command nice (i have seen functional somewhere in gambas too)

and an application that compares the data ... uh yes ... if you have two mysql servers running anyway (i hope you mean mariadb) have a look at the terms replication, and/or cluster and let the one who can do it best do the work ...
if you need something small on the client side you could also use sqlite and mariadb/mysql on the server ... also with this the replication works


Translated with www.DeepL.com/Translator
@PJBlack
Yes Replication would be a way to do this but it would replicate EVERY things from the Master Database to the Local PoS Database and I do not need every table and every field on the local PoS Database.

I have created the sync app so I can control what information is sent to the master database (mysql) and what is deleted from the local Database.

Does anyone have any examples of how to use sqlite with Gambas?

User avatar
PJBlack
Posts: 156
Joined: Tuesday 09th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

Re: Advise on a idea

Post by PJBlack » Thursday 22nd July 2021 6:04pm

AndyGable wrote:
Thursday 22nd July 2021 12:26pm
Does anyone have any examples of how to use sqlite with Gambas?
https://gambaswiki.org/wiki/howto/databasesqlite
https://gambaswiki.org/wiki/comp/gb.db/connection
https://www.sqlite.org

the difference between sqlite and real dbms is a) the lack of user management, b) sqlite is local and file based and c) the usual small things ...

if you have a connection open sqlite will be accessed via sql just like other databases ...

AndyGable wrote:
Thursday 22nd July 2021 12:23pm
That does not put the application into the background that only makes the app screenless.
https://gambaswiki.org/wiki/comp/gb/app ... n/priority
https://gambaswiki.org/wiki/comp/gb/application/daemon

Post Reply