Hello Guest it is March 28, 2024, 08:58:17 AM

Author Topic: Mach MAD Plug in (Maintenance and Diagnostics)  (Read 93521 times)

0 Members and 1 Guest are viewing this topic.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Mach MAD Plug in (Maintenance and Diagnostics)
« Reply #20 on: February 05, 2009, 09:20:03 AM »
Ok
      thanks guys, James has found and offered the solution for the error message if you uncheack plug in enable and shut down.
I had gotten this also, but, it didnt really effect anything.  Mach Comes back up fine.............

BUT, I will implement his fix for this and resend you all a version 1.2

Fernando:  The Cheack box for the LEDs is a "Read Only" check box. it just reports the state of the led your looking at you cannot change the state of an LED by cheacking or uncheacking the LED check box.  The only way it changes is for you to push the toggle button. the code in the button flips its state and the cheack box just reports its new state.

I will look and see if there is a way to disable unser Input into the check box, if there is, I will fix it to, otherwise it will have to stay.

I was looking for some quicky, "Owner Draw", code in which I could replace the cheack with a solid green, and un cheack with solid Grey, like the LEDs do in Mach.

scott
fun times

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Mach MAD Plug in (Maintenance and Diagnostics)
« Reply #21 on: February 05, 2009, 09:53:11 AM »
Hey James tryied your solution, I still get the error box after unticking and closing Mach3.  The Error box is really no big deal, I just push NO on attempt recovery, and mach comes back up just fine.

I put this up with my Includes on the MachDeviceimplementation.cpp

#include "MainPage_Dlg.h"  //****The header file for the Dialog for this plugin***
#include "Buttons_Dlg.h"
#include "DROs_Dlg.h"
#include "LEDs_Dlg.h"
#include "SerialModbus_Dlg.h"
#include "TCPModbus_Dlg.h"
#include "LabelTickers_Dlg.h"
#include "SSSystemsLLC_dlg.h"

#define SHUTDOWN      0x12000e         // Undocumented notification

Here is what mynotify looks like:

void   myNotify ( int ID)
{
   if( ID == RangeStart )
   {
      dlg->ShowWindow(SW_SHOW);
   }

   if (ID == SHUTDOWN)
   {   
      if (NULL != dlg) {

         dlg->DestroyWindow();
         mach3CWnd.Detach();
         delete dlg;
      }dlg = NULL;

      if (NULL != dlg2) {

         dlg2->DestroyWindow();
         mach3CWnd.Detach();
         delete dlg2;
      }dlg2 = NULL;

      if (NULL != dlg3) {

         dlg3->DestroyWindow();
         mach3CWnd.Detach();
         delete dlg3;
      }dlg3 = NULL;

      if (NULL != dlg4) {

         dlg4->DestroyWindow();
         mach3CWnd.Detach();
         delete dlg4;
      }dlg4 = NULL;

      if (NULL != dlg5) {

         dlg5->DestroyWindow();
         mach3CWnd.Detach();
         delete dlg5;
      }dlg5 = NULL;

      if (NULL != dlg6) {

         dlg6->DestroyWindow();
         mach3CWnd.Detach();
         delete dlg6;
      }dlg6 = NULL;

      if (NULL != dlg7) {

         dlg7->DestroyWindow();
         mach3CWnd.Detach();
         delete dlg7;
      }dlg7 = NULL;

      if (NULL != dlg8) {

         dlg8->DestroyWindow();
         mach3CWnd.Detach();
         delete dlg8;
      }dlg8 = NULL;      
   }

} //myNotify

I get Error code 9991 attemp recovery after changing from enabled to disapbled and closing. Like I said it really isnt a big deal, Mach will reopen, I just tick NO on attempt recovery.  I can go back and reenable the plug in, close and reopen, and it all works fine again.........

scott

fun times
Re: Mach MAD Plug in (Maintenance and Diagnostics)
« Reply #22 on: February 05, 2009, 10:07:47 AM »
Scott,

The resources I am freeing are apparently not the same as what you need to free.  Since you are using MFC modeless dialogs the dlg->DestroyWindows is probably appropriate.  BUT, if your plugin shuts down clean when the 'MyCleanup()' is called why not just put the code you have there into a function and call it from the SHUTDOWN notification?

Also, if you use the DbgMsg library I posted with my tutorial (dbg.cpp and dbg.h) you can put trace messages in to see exactly where the code is failing.

-James
« Last Edit: February 05, 2009, 10:10:12 AM by jemmyell »

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Mach MAD Plug in (Maintenance and Diagnostics)
« Reply #23 on: February 05, 2009, 03:21:35 PM »
the code is I posted I pasted over from the MyCleanup function so now it is in two places in the cleanup for normal closure and in the mynotivy for disableling and then closing...........

I use "MessageBox" in my code to see what is happening, (a trick Ed sold me on).  I guess it just doesnt work for my case, and that is ok, the error doesnt realy do anything just an annoyance.

thanks for your time and suggestions though.

scott
fun times

Offline budman68

*
  • *
  •  2,352 2,352
    • View Profile
Re: Mach MAD Plug in (Maintenance and Diagnostics)
« Reply #24 on: February 05, 2009, 03:33:22 PM »
Quote
and that is ok, the error doesnt realy do anything just an annoyance.

Indeed but you may want to at least add this info to your program so you don't get asked about it over and over -  ;)

Dave
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Mach MAD Plug in (Maintenance and Diagnostics)
« Reply #25 on: February 05, 2009, 03:45:51 PM »
I will Add a "Read Me 1st" in the Zip file, for future installers going out, that explains this.........

Good Idea Dave.....

scott
fun times
Re: Mach MAD Plug in (Maintenance and Diagnostics)
« Reply #26 on: February 10, 2009, 11:29:16 AM »
Hi Scott,

Here is a good article on owner draw LED style controls.

http://www.codeproject.com/KB/buttons/LedButton.aspx

-James


Ok
      thanks guys, James has found and offered the solution for the error message if you uncheack plug in enable and shut down.
I had gotten this also, but, it didnt really effect anything.  Mach Comes back up fine.............

BUT, I will implement his fix for this and resend you all a version 1.2

Fernando:  The Cheack box for the LEDs is a "Read Only" check box. it just reports the state of the led your looking at you cannot change the state of an LED by cheacking or uncheacking the LED check box.  The only way it changes is for you to push the toggle button. the code in the button flips its state and the cheack box just reports its new state.

I will look and see if there is a way to disable unser Input into the check box, if there is, I will fix it to, otherwise it will have to stay.

I was looking for some quicky, "Owner Draw", code in which I could replace the cheack with a solid green, and un cheack with solid Grey, like the LEDs do in Mach.

scott

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Mach MAD Plug in (Maintenance and Diagnostics)
« Reply #27 on: February 10, 2009, 04:43:13 PM »
Mach MAD version 1.2 was sent out today to all, I have added a new feature!!!

the Control LED and User LED choice is now Remembered between opening/closing of Mach3 (I had several request for it, so I added it).
ALSO:  The control LED will SHOW the "Quick Picks" when you turn it on, AND, it will HIDE the ANY and ALL of the pages when it is turned off (upto all 8 of them).
When you Turn the LED back on, only the Quick Picks page will SHOW again, you will have to use it to launch SHOW the other pages like usuall. Just realize that if you playing with the LED functions and you toggle the state of the USER LED that you have choosen to contol the visibility of the windows you can turn yourself off..........

I put a "MAD Diagnostics" Button and LED on my Screen sets on my Diagnostics page, comes in real handy.

Further: I have NOT really noticed any impact on the Processor use time, with constantly running MAD vs. not running it. My comp has a 1.6 gig processor, so if your running a slow(er) comp check to see if you see any real impact if not, you can probably run it all the time if you want.

Scott
fun times

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Mach MAD Plug in (Maintenance and Diagnostics)
« Reply #28 on: February 12, 2009, 10:10:26 AM »
Greetings,

    I made a "Stock OEM" Mach Mill screen set that has a "Mach MAD" button and LED next to it, to control the appearance and disappearence of the MAD Windows.
I put the Button/LED at the lower Left under the "History" and "Clear" buttons.  The Control LED next to it is UserLED 2220. You will need to put this number
in the Control LED box on the quick picks page, and hit the UPDATE button, also make sure the Radio button for "Use Control LED" is turned on.  If you are using Version 1.3 from the installer that I sent out to everyone, then Mach will remember the state of the control LED/and User number next time you open it.

The Screen set is called:  1024MAD.set
NOTE: the button and led are on the "Park" page so they display on all screens.

it is attached,

scott
fun times

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Mach MAD Plug in (Maintenance and Diagnostics)
« Reply #29 on: February 15, 2009, 12:04:41 PM »
Version 1.4 has been sent to everyone on the list.
I added version information to the top title bar of the Quick Pics dialog window.
Also: The new installer will install the IMPROVED MAD screen set.......  I upgraded from the
screen above to there is a Cool "Ring" type LED around the Mach MAD button!! (like the one around the Resetbutton).

Read the Read me file that comes in the Zip, it will tell you about other minor changes/upgrades...

scott
fun times