Dynomotion

Group: DynoMotion Message: 10180 From: TKSOFT Date: 9/17/2014
Subject: KMotion/KFlop Test Version 4.33f Available

KMotion/KFlop Test Version 4.33f Available

This fixes a significant bug in the introduced in Test Version 4.33d where KMotionCNC might crash when using MDI, Tool Changes, Fixture Offsets.  The bug was related to logging run times after an Interpreter operation.

KMotionCNC now permits multiple Jog buttons (Arrow Keys) to be pushed simultaneously.



For details see:
http://www.dynomotion.com/Software/KMotion%20Released%20Version%204.33f%20Changes.pdf


Download here:
http://www.dynomotion.com/Software/KMotion433f.exe


Please report any issues.

Regards,

Dynomotion, Inc.



Group: DynoMotion Message: 10185 From: eric_kato_sanders Date: 9/18/2014
Subject: Re: KMotion/KFlop Test Version 4.33f Available
Hi Tom,
In doing a source file compare, I see a bug was introduced in the CImageButton constructor.
The constructor used to have:

CImageButton::CImageButton(UINT up, UINT down, UINT disabled, BOOL fill)
 { 
     this->up = up;
     this->down = down;
     this->disabled = disabled;
     this->m_fill = fill;
}
 
Version f has it as:

CImageButton::CImageButton(UINT up, UINT down, UINT disabled, BOOL fill)
{
up = up;
down = down;
m_fill = fill;
disabled = disabled;
DrawPushed=ForceDisableFocus=false;
}

The CImageButton member variables u,p down, and disabled will never be set since the constructor variables have the same name.  My suggestion would be to prefix the conventional m_ to the all the CImageButon member variables that are missing them.
Eric
Group: DynoMotion Message: 10187 From: Tom Kerekes Date: 9/18/2014
Subject: Re: KMotion/KFlop Test Version 4.33f Available
Hi Eric,

Thanks you are correct.  We have applied your suggestion.

But that code is not currently used so it should not be a problem for the current Version.

Regards
TK


Group: DynoMotion Message: 10198 From: eric_kato_sanders Date: 9/24/2014
Subject: Re: KMotion/KFlop Test Version 4.33f Available
Hi Tom,
I have one additional suggestion related to this bug.  I would introduce this safeguard one level deeper as well, making sure that m_ThreadThatWasLaunched is valid..
Eric


void CKMotionCNCDlg::LogJobEndTime(double seconds)
{
   if(m_ThreadThatWasLaunched > -1 && m_ThreadThatWasLaunched < N_USER_GCODE_FILES)
   {
      CString File=TheFrame->MainPathRoot+LOG_RUNTIME_FILE,s;
      CStdioFile f;
      if(f.Open(File, CFile::modeCreate|CFile::modeWrite|CFile::modeNoTruncate))
      {
         f.SeekToEnd();

         CString time = CTime::GetCurrentTime().Format( "%a, %b %d, %Y, %I:%M:%S  ");
         s.Format("%sElapsed Job Time:%12.1f sec %s\n", time, seconds, FileNames[m_ThreadThatWasLaunched] ); 
         f.WriteString(s);
         f.Close();
      }
      else
      {
         AfxMessageBox("Unable to open Runtime Log File\r\r" + File);
      }
   }
}
Group: DynoMotion Message: 10202 From: Tom Kerekes Date: 9/24/2014
Subject: Re: KMotion/KFlop Test Version 4.33f Available
Hi Eric,

The latest Test Release has the code show below.  Isn't that effectively the same?  Or am I missing something?

Regards
TK


void CKMotionCNCDlg::LogJobEndTime(double seconds)
{
    CString File=TheFrame->MainPathRoot+LOG_RUNTIME_FILE,s;
    CStdioFile f;

    if (m_ThreadThatWasLaunched>=0 && m_ThreadThatWasLaunched<N_USER_GCODE_FILES)
    {
        if(!f.Open(File, CFile::modeCreate|CFile::modeWrite|CFile::modeNoTruncate))
        {
            AfxMessageBox("Unable to open Runtime Log File\r\r" + File);
            return;
        }

        f.SeekToEnd();

        CTime t = CTime::GetCurrentTime();
        CString time = t.Format( "%a, %b %d, %Y, %I:%M:%S  " );   

        s.Format("Elapsed Job Time:%12.1f sec ",seconds);
        s=time + s + FileNames[m_ThreadThatWasLaunched] + "\n";
        f.Write(s,s.GetLength());
        f.Close();
    }
}


From: "eric@... [DynoMotion]" <DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Wednesday, September 24, 2014 7:33 AM
Subject: [DynoMotion] Re: KMotion/KFlop Test Version 4.33f Available

 
Hi Tom,
I have one additional suggestion related to this bug.  I would introduce this safeguard one level deeper as well, making sure that m_ThreadThatWasLaunched is valid..
Eric


void CKMotionCNCDlg::LogJobEndTime(double seconds)
{
   if(m_ThreadThatWasLaunched > -1 && m_ThreadThatWasLaunched < N_USER_GCODE_FILES)
   {
      CString File=TheFrame->MainPathRoot+LOG_RUNTIME_FILE,s;
      CStdioFile f;
      if(f.Open(File, CFile::modeCreate|CFile::modeWrite|CFile::modeNoTruncate))
      {
         f.SeekToEnd();

         CString time = CTime::GetCurrentTime().Format( "%a, %b %d, %Y, %I:%M:%S  ");
         s.Format("%sElapsed Job Time:%12.1f sec %s\n", time, seconds, FileNames[m_ThreadThatWasLaunched] ); 
         f.WriteString(s);
         f.Close();
      }
      else
      {
         AfxMessageBox("Unable to open Runtime Log File\r\r" + File);
      }
   }
}


Group: DynoMotion Message: 10205 From: eric_kato_sanders Date: 9/25/2014
Subject: Re: KMotion/KFlop Test Version 4.33f Available
Hi Tom,
You are absolutely right.  When a new version comes out I do a file compare with the previous version and incorporate the changes into my source code.  Somewhere along the line I must have missed the addition of the thread number validation.  The other changes I made to the code are just coding style.  In general it is good practice to avoid mid procedure return statements when you can because it is easy to miss deallocations and such that would typically be at the end of the procedure.
Eric