Page 1 of 1

Get an error clicking on the DRO field.

PostPosted: Tue Aug 07, 2018 9:28 am
by kig23
Hi,
i've a strange issue. I'm creating a new screenset. My problem is the following. When i click on the MDI field and then click on the X axis DRO field a get an exception. Here is the exception text :
Code: Select all
************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at UCCNC.GUI.Leavetextfieldswithoutvalidation()
   at UCCNC.GUI.gl_main_mousedown(Object , MouseEventArgs )
   at UCCNC.Form1.glControl2_MouseDown(Object , MouseEventArgs )
   at System.Windows.Forms.Control.OnMouseDown(MouseEventArgs e)
   at System.Windows.Forms.UserControl.OnMouseDown(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.UserControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


I've attached the picture of the error. I need some advices. Thanks

Re: Get an error clicking on the DRO field.

PostPosted: Tue Aug 07, 2018 9:33 am
by cncdrive
An index is out of range for something, but I can't tell you what exactly.
If you will post the screenset and will tell me what to exactly do (step by step) then I can debug it for you.

Re: Get an error clicking on the DRO field.

PostPosted: Tue Aug 07, 2018 11:00 am
by kig23
Thanks Balazs for you fast replay. I've attached the screetset file. The .ssf file has only UC100 device screenset. You can create a new profile and change the screenset file with attached file. When you open UCCNC just click on the MDI field without typing and then click on the X axis DRO field and you'll see the exception. Thank you for your help.

Re: Get an error clicking on the DRO field.

PostPosted: Tue Aug 07, 2018 1:08 pm
by cncdrive
I've checked the issue and it happens because there is no DRO on the jogpanel and there is a code in the software which starts checking the DROs and because the array which holds the jogpanel's DROs is empty an exception happens. It is not handled, because we did not think about this scenario that somebody removes all the DROs from the jogpanel.

Re: Get an error clicking on the DRO field.

PostPosted: Tue Aug 07, 2018 2:24 pm
by kig23
Thank you very much.