Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:43 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Can we Reconsidering GUI commands for the CMM2

     Page 1 of 2    
Author Message
mclout999
Guru

Joined: 05/07/2020
Location: United States
Posts: 490
Posted: 01:44pm 12 Jul 2021
Copy link to clipboard 
Print this post

Hi all. At one point in a beta program for what seemed like a blink of an eye, we had quite nice GUI commands added.  I was just getting into learning how to use them and they were removed.  Now that we have 2 standardized MOUSE options would anyone want those GUI functions added back in?  I understand if they are not feasible at the current limitation of command slots but I would like for a standard fast integrated GUI option for the CMM3. I am just wondering if that would be of interest to a lot of the user base.  Thanks for your consideration and discusion.
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1427
Posted: 04:10pm 12 Jul 2021
Copy link to clipboard 
Print this post

This could be done as a CSUB or a group of CSUBS. I'm far from the person to do this, though.

I'd love to see a fast text version of this that uses the block characters like visual basic for DOS did.
Micromites and Maximites! - Beginning Maximite
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 06:36pm 12 Jul 2021
Copy link to clipboard 
Print this post

It's a nice idea, but I think the GUI components we briefly had were designed for implementing touch sensitive control panels so not necessarily an appropriate and sufficient set for an 8/16-bit mouse driven GUI.

The only way I see this or CG's oft-stated (3 times and counting) wish happening is as a by-product of some other development; if it happens I would guess it will probably have to be the development of an IDE ... and because the firmware doesn't provide the necessary hooks to support an IDE for MMBasic it would have to be an IDE for some other language.

That at least is my 2 cents ... I may of course be talking bo**ocks.

Best wishes,

Tom
Edited 2021-07-13 05:03 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 08:07pm 12 Jul 2021
Copy link to clipboard 
Print this post

The brief appearance then disappearance of the GUI commands was down to me.  Peter put them in but I objected saying that the CMM2 was not an embedded controller like the Micromite Plus (which is where the GUI commands came from).  I just could not see how people would use them and did not want to clutter the CMM2 with unused features.

Is there a demand for these?  What would people use them for given that they are intended for a touch screen controller?

If you are wondering what the GUI commands are, you can read about them in the Micromite Plus Manual (starting at page 30).

Geoff
Geoff Graham - http://geoffg.net
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1427
Posted: 08:12pm 12 Jul 2021
Copy link to clipboard 
Print this post

  thwill said  
The only way I see this or CG's oft-stated (3 times and counting) wish


Probably more times than that, man!
Micromites and Maximites! - Beginning Maximite
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1427
Posted: 08:18pm 12 Jul 2021
Copy link to clipboard 
Print this post

  Geoffg said  The brief appearance then disappearance of the GUI commands was down to me.  Peter put them in but I objected saying that the CMM2 was not an embedded controller like the Micromite Plus (which is where the GUI commands came from).  I just could not see how people would use them and did not want to clutter the CMM2 with unused features.

Is there a demand for these?  What would people use them for given that they are intended for a touch screen controller?

If you are wondering what the GUI commands are, you can read about them in the Micromite Plus Manual (starting at page 30).

Geoff


I also feel that they may not belong built into the language. But could certainly be a library or CSUB.
Micromites and Maximites! - Beginning Maximite
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 08:30pm 12 Jul 2021
Copy link to clipboard 
Print this post

Because the CMM2 now has good mouse support, it would be possible to replace touch with mouse (but I'm not going to speculate as to how difficult that would be).

In the port of VegiPete's CMM2 missle-command clone to the F4, I went the other way, and replaced mouse with touch--all in basic, of course (while retaining mouse support for the same code on the CMM2).

Re a text GUI, it's not a full implementation, but user flip made a decent start with Pseudo-Multi-tasker for MMBasic for DOS back in 2017. Several CMM2 utilities provide some sort of windowing I think.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1097
Posted: 11:44pm 12 Jul 2021
Copy link to clipboard 
Print this post

After playing with the LED graphics on an F4, & realising how useful they were, (Yeah, I'm a bit behind on some of these things); I went looking for the LED graphic for the CMM2 but alas, not to be found. Bit disappointed.
It is a different beast as Geoff implies.

Brian
Edited 2021-07-13 09:44 by Chopperp
ChopperP
 
mclout999
Guru

Joined: 05/07/2020
Location: United States
Posts: 490
Posted: 05:15am 13 Jul 2021
Copy link to clipboard 
Print this post

I think mouse + keyboard shortcuts bases GUI would be very useful but I defer to the will of the people and the inestimable wisdom of our developers.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 08:49am 13 Jul 2021
Copy link to clipboard 
Print this post

I think the difference in the systems is that the CMM2 isn't intended to be a controller, it's a computer. The platforms that do use the extended GUI commands are all fundamentally embedded controllers. However, I think that *some sort* of GUI library would be nice on the CMM2, to use it as a workstation to control remote outstations. It could just be a set of Subs/Functions/Csubs. I don't think there's any need to put anything special into MMBasic, the CMM2 has plenty of memory and is plenty fast enough to handle screen displays and mouse clicks.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 05:37pm 13 Jul 2021
Copy link to clipboard 
Print this post

Here is an experimental version of the CMM2 firmware with a full GUI implementation.


CMM2V5.07.01exp1.zip






This is exactly like the MM+ with the exception that the PAGE command on the MM+ is now the GUI PAGE command on the CMM2. I've kept the TOUCH function exactly like the MM+ but of course "touch" refers to a left mouse button press. Beep is not implmented but is trivial to do in Basic using the PLAY TONE command in the touchdown interrupt.

To use the GUI commands you must have set up a mouse using the OPTION MOUSE command. In addition you must allocate memory to the GUI controls using the command OPTION MAXCTRLS n. By default this is 0 in which case the GUI implementation will have no impact on the CMM2 performance or operation. This is a permanent option.

Assuming this is all set-up and a mouse is connected the first use of a GUI command will automatically initialise the mouse and cursor. Then use the mouse to move the cursor round the screen and left click to activate the controls.

As before there is no guarantee that this functionality will make the cut for the next release however as the mouse support is now properly integrated it makes more sense and appears to work very nicely (limited testing)

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Demonstration program for the Micromite+
' It does not do anything useful except demo the various controls
' Modified for ILI9341 by Phil23
'
' Geoff Graham, October 2015
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
mode 7
Option Explicit
Dim ledsY
Colour RGB(white), RGB(black)
' reference numbers for the controls are defined as constants
Const c_head = 1, c_pmp = 2, sw_pmp = 3, c_flow = 4, tb_flow = 5
Const led_run = 6, led_alarm = 7
Const frm_alarm = 20, nbr_hi = 21, nbr_lo = 22, pb_test =23
Const c_hi = 24, c_lo = 25
Const frm_pump = 30, r_econ = 31, r_norm = 32, r_hi = 33
Const frm_log = 40, cb_enabled = 41, c_fname = 42, tb_fname = 43
Const c_log = 44, cb_flow = 45, cb_pwr = 46, cb_warn = 47
Const cb_alarm = 48, c_bright = 49, sb_bright = 50
' now draw the "Pump Control" display
CLS
'setpin 18,dout
'pin(18)=1
GUI Interrupt TouchDown, TouchUp
' display the heading
Font 2 : GUI Caption c_head, "Pump Control", 10, 0
Font 2 : GUI Caption c_pmp, "Pump", 10, 25, , RGB(brown)
' now, define and display the controls
' first display the switch
Font 2
GUI Switch sw_pmp, "ON|OFF", 10, 45, 70, 30, RGB(white),RGB(brown)
CtrlVal(sw_pmp) = 1
' the flow rate display box
Font 2 : GUI Caption c_flow, "Flow Rate", 5, 75,, RGB(brown),0
Font 2 : GUI Displaybox tb_flow, 5, 100, 105, 25
CtrlVal(tb_flow) = "20.1"
' the radio buttons and their frame
Font 2 : GUI Frame frm_pump, "Power", 5, 140, 105, 90,RGB(200,20,255)
Font 1
GUI Radio r_econ, "Economy", 20, 160, 10, RGB(230, 230, 255)
GUI Radio r_norm, "Normal", 20, 185
GUI Radio r_hi, "High", 20, 210
CtrlVal(r_norm) = 1 ' start with the "normal" button selected
' the alarm frame with two number boxes and a push button switch
Font 2 : GUI Frame frm_alarm, "Alarm", 115, 115, 90, 115,RGB(green)
Font 1
GUI Caption c_hi, "Hi:", 120, 150, LT, RGB(yellow)
GUI Numberbox nbr_hi, 150,MM.VPos-6,40,MM.FontHeight+6,RGB(yellow),RGB(64,64,64)
GUI Caption c_lo, "Lo:", 120, 175, LT, RGB(yellow),0
GUI Numberbox nbr_lo, 150,MM.VPos-6,40,MM.FontHeight+6,RGB(yellow),RGB(64,64,64)
GUI Button pb_test, "TEST", 125, 200, 70, 25,RGB(yellow), RGB(red)
CtrlVal(nbr_lo) = 15.7 : CtrlVal(nbr_hi) = 35.5
' draw the two LEDs
Const ledsX = 125, coff = 50 ' define their position
ledsY = 50 : GUI LED led_run, "Running", ledsX, ledsY, 8, RGB(green)
ledsY = ledsY+25 : GUI LED led_alarm, "Alarm", ledsX, ledsY, 8, RGB(red)
CtrlVal(led_run) = 1 ' the switch defaults to on so set the LED on
' the logging frame with check boxes and a text box
Colour RGB(cyan), 0
GUI Frame frm_log, "Log File", 210, 10, 110, 160, RGB(green)
GUI Checkbox cb_enabled, "Log On", 215, 20, 20, RGB(cyan)
GUI Caption c_fname, "File Name", 215, 45
GUI Textbox tb_fname, 215, 60, 100, 20, RGB(cyan), RGB(64,64,64)
GUI Caption c_log, "Record:", 215, 85, , RGB(cyan), 0
GUI Checkbox cb_flow, "Flow", 220, 100, 20
GUI Checkbox cb_alarm, "Alarms", 220, 120, 20
GUI Checkbox cb_warn, "Warnings", 220, 140, 20
CtrlVal(cb_enabled) = 1
CtrlVal(tb_fname) = "LOGFILE.TXT"
' define and display the spinbox for controlling the backlight
GUI Caption c_bright, "Back Light", 230, 190,,RGB(200,200,255),0
GUI Spinbox sb_bright, 210, 210, 110, 25,,,10, 10, 100
CtrlVal(sb_bright) = 100
' All the controls have been defined and displayed. At this point
' the program could do some real work but because this is just a
' demo there is nothing to do. So it just sits in a loop.
Do :Loop
' the interrupt routine for touch down
' using a select case command it has a different process for each
' control
Sub TouchDown
Select Case Touch(REF) ' find out the control touched
Case cb_enabled ' the enable check box
If CtrlVal(cb_enabled) Then
GUI Restore c_fname, tb_fname, c_log, cb_flow, cb_alarm, cb_warn
Else
GUI Disable c_fname, tb_fname, c_log, cb_flow, cb_alarm, cb_warn
EndIf
Case sb_bright ' the brightness spin box
'BackLight CtrlVal(sb_bright)
Case sw_pmp ' the pump on/off switch
CtrlVal(led_run) = CtrlVal(sw_pmp)
CtrlVal(tb_flow) = Str$(CtrlVal(sw_pmp) * 20.1)
CtrlVal(r_norm) = 1
Case pb_test ' the alarm test button
CtrlVal(led_alarm) = 1
'GUI beep 250
Case r_econ ' the economy radio button
CtrlVal(tb_flow) = Str$(CtrlVal(sw_pmp) * 18.3)
Case r_norm ' the normal radio button
CtrlVal(tb_flow) = Str$(CtrlVal(sw_pmp) * 20.1)
Case r_hi ' the high radio button
CtrlVal(tb_flow) = Str$(CtrlVal(sw_pmp) * 23.7)
End Select
End Sub
' interrupt routine when the touch is removed
Sub TouchUp
Select Case Touch(LASTREF) ' use the last reference
Case pb_test ' was it the test button
CtrlVal(led_alarm) = 0 ' turn off the LED
End Select
End Sub

Edited 2021-07-14 03:42 by matherp
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 06:42pm 13 Jul 2021
Copy link to clipboard 
Print this post

GUIDEMO.BAS works perfectly for me, thanks.

Hope it stays, though I don't know what I would actually use it for.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7937
Posted: 07:48pm 13 Jul 2021
Copy link to clipboard 
Print this post

Nice one, Peter. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1427
Posted: 08:27pm 13 Jul 2021
Copy link to clipboard 
Print this post

Someone will ask for keyboard support, I'm sure. Can you programmatically move the mouse position? Force a click? I suppose that would mean setting up the pointer w/o actual mouse hardware.
Micromites and Maximites! - Beginning Maximite
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 09:32pm 13 Jul 2021
Copy link to clipboard 
Print this post

  Quote  Someone will ask for keyboard support, I'm sure.

They can ask

  Quote  Can you programmatically move the mouse position? Force a click? I suppose that would mean setting up the pointer w/o actual mouse hardware.


No: no mouse, no GUI
 
Rado
Regular Member

Joined: 27/11/2020
Location: Croatia
Posts: 59
Posted: 11:34am 14 Jul 2021
Copy link to clipboard 
Print this post

My $0.02 is that people will eventually find a way to use GUI commands in their software - I assume they are universal, so they can be used for many different things: to control the range in a calculation or a graph, to turn program features on and off, to use as a control panel in a starship rendition of No Man's Sky for CMM (tee hee hee...)

In fact, I can imagine many uses for both character-mode and graphics-mode built-in UI elements.
I think it would be fine even if we could create (and more importantly, agree on) a standardized library to be included in code, it doesn't necessarily have to reside in firmware.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 11:48am 14 Jul 2021
Copy link to clipboard 
Print this post

  Rado said  I think it would be fine even if we could create (and more importantly, agree on) a standardized library to be included in code, it doesn't necessarily have to reside in firmware.


My 2c is that GUI components/controls should not be in the firmware - because (a) I agree with Geoff's argument about the CMM2 not being intended as an embedded controller and (b) I don't think we need Peter/Geoff to be reponsible for maintaining even more code. HOWEVER, it hasn't used up any command slots (GUI was already present for the pointer), and I assume there is still no shortage of firmware flash, so it doesn't exactly spoil my fun having them there.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 11:56am 14 Jul 2021
Copy link to clipboard 
Print this post

  Quote   I don't think we need Peter/Geoff to be reponsible for maintaining even more code.


They use standard MM+ code that is extensively tested so no significant support overhead. The tweak to use them on the CMM2 is just to integrate the mouse rather than touch. There are no further new commands envisaged so this is just a case of adding existing code and using the free slots that were there.

My view FWIW is that now the CMM2 code is reasonably mature and the mouse integration works well the GUI commands add useful functionality for lots of potential "non-embedded" applications and so the previous arguments against no longer carry as much weight. With OPTION MAXCTRLS set to 0 the new functionality imposes no overhead on the firmware so can be ignored completely for anyone who doesn't need it.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 12:47am 15 Jul 2021
Copy link to clipboard 
Print this post

I had trouble loading either exp1 or exp2.
As reported elsewhere, blank screen and no serial console response.

Eventually managed to get exp2 running.

Jim
VK7JH
MMedit
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 07:41am 15 Jul 2021
Copy link to clipboard 
Print this post

  Quote  I had trouble loading either exp1 or exp2.


I think it's because of the option for maxctrls. Should work if you erase all before programming but I'll put a check in the next version. If you did this and it didn't work then please detail what you did to finally get it working.
Edited 2021-07-15 17:52 by matherp
 
     Page 1 of 2    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025