Advise on a idea

Post your Gambas programming questions here.
AndyGable
Posts: 359
Joined: Wednesday 2nd December 2020 12:11am
Location: Northampton, England
Contact:

Advise on a idea

Post by AndyGable »

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: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Advise on a idea

Post by BruceSteers »

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
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Advise on a idea

Post by BruceSteers »

if you want your app to talk to other gambas apps of yours then look into DBus
If at first you don't succeed , try doing something differently.
BruceS
AndyGable
Posts: 359
Joined: Wednesday 2nd December 2020 12:11am
Location: Northampton, England
Contact:

Re: Advise on a idea

Post by AndyGable »

I'm using pipe to talk between the apps
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Advise on a idea

Post by BruceSteers »

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
If at first you don't succeed , try doing something differently.
BruceS
User avatar
PJBlack
Posts: 184
Joined: Tuesday 9th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

Re: Advise on a idea

Post by PJBlack »

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: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: Advise on a idea

Post by BruceSteers »

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

If at first you don't succeed , try doing something differently.
BruceS
AndyGable
Posts: 359
Joined: Wednesday 2nd December 2020 12:11am
Location: Northampton, England
Contact:

Re: Advise on a idea

Post by AndyGable »

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: 359
Joined: Wednesday 2nd December 2020 12:11am
Location: Northampton, England
Contact:

Re: Advise on a idea

Post by AndyGable »

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: 184
Joined: Tuesday 9th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

Re: Advise on a idea

Post by PJBlack »

AndyGable wrote: Thursday 22nd July 2021 12:26pmDoes 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:23pmThat 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