We need a python GUI code and a python controller code communicating with GUI code. UI code will be displaying some changes based on controller code communication and some things based on buttons in UI. About the communication, we have some ideas using a global queue or so, but we are not sure of any standard way of a UI script communicating with a regular python script which we expect you will be having better idea of.
The UI contains 3 sections which will receive a string/json from controller python code and/or a click of any button.
1. On reception of json 1 from controller, fetch table number from received json and check whether it is present in Incorrect Bills section or not; if exists, remove it from Incorrect Bill section and show the same table number in a circular yellow icon in Print Bills section.
2. When json 2 received from controller, fetch table number from received json; the table number should be displaying in Print Bill section in circular yellow icon for now. Change the background color of circular icon to green for that table number.
3a. On reception of json 3 from controller, fetch table number from received json and check whether it is present in Print Bills section or not; if exists, remove it from Print Bills section and show the same table number as circular button in Incorrect Bills section.
3b. In Incorrect Bills section, on button click, a dialog should popup and show the content received under data field of json 3.
4. On receiption of json 4/5 from controller, fetch table number from received json and check whether it is present in Print Bills section or not; if exists, remove it from Print Bills section. Show the data received in json in tabular form in Verify/collect payment section.
4a. Json 4 is for offline mode - in this case, an entry should be added in tabular display for respective table number with mode shown as 'offline', Amount column should be left blank and only one button should be enabled with 'Collect' on it. On click on this button, UI script should send controller code json 6 and then remove the entry with respective table number from tabular display. The other button can be invisible or be kept disabled (if invisible is impossible).
4b. Json 5 is for online mode - in this case, the entry should be added in tabular display for respective table number with mode shown as 'online', Amount column should display the number separated by '-' in data field of json, and two buttons, one with label 'Verified' and other with label 'Hold'.
On 'verified' button click, json 6 should be sent to controller code and the entry for that table should be removed from tabular display.
On 'Hold' button click, json 7 should be sent to controller code and whole row containing that table should be shown in grayish color with only 'verified' button enabled. If clicked on 'verified' button aftrwards, same activity should happen as mentioned earlier.
As the communication flow demands, the controlled code should be able to receive and send data to UI application. You can simulate controller code part as sending data in every say, 30 secs and listening for message from UI code in between.
On launch of application, all three sections should diaplay 'No Data To Display'.
The UI should be scrollable. The message displayed in pop-up shown on click on buttons in Incorrect Bills section should be scrollable too.
JSON-
1. {
'event': 'billReq',
'table': 'G12',
'data': ''
}
2. {
'event': 'billReq',
'table': 'G12',
'data': 'Green'
}
3. {
'event': 'wrongBill',
'table': 'G12',
'data': ''
}
4. {
'event': 'payment',
'table': 'G12',
'data': 'offline-na'
}
5. {
'event': 'payment',
'table': 'G12',
'data': 'online-215.45'
}
6. {
'event': 'verify',
'table': 'G12',
'data': 'success'
}
7. {
'event': 'verify',
'table': 'G12',
'data': 'failed'
}
About the recuiterMember since Mar 14, 2020 Mindiaesh Sharm
from Ohio, United States