Jump to content

MoreWood

Members
  • Posts

    58
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by MoreWood

  1. 7 часов назад, Viktor Akselrod сказал:

    Hola @Mas madera


    Hemos corregido la traducción en la próxima versión.

    Traducción correcta:

    
    You must select at least one type of devices for the iOS platform.

    Gracias.

     But , if I don't want a iOS project, I must select one?

  2. 12 минут назад, Viktor Akselrod сказал:

    Hello.

    TfgAnimationHelper.HideForm(Self, [TfgAnimationOption.ReleaseOnFinish]) - this call does not close immediately form.

    first plays the animation, then enqueues the deletion and only then deletes the form.
    during this time fgBarcodeScanDetected may fire several more times.

    so it is important to prevent for double form destruction.

    Ok, I added the check if FCamera = nil then Exit, anyway the memory problem persist, I imagine it will solved with new release, thanks.

  3. 8 часов назад, Viktor Akselrod сказал:

    Besides the bugfix, please fix the logic as follows:

    
    procedure TFCamera.CloseForm (OK: boolean);
    begin
      if FCamera = nil then
        Exit;
    
      if OK and Assigned (FOnReadCode) and (fgLabCode.Text <> '-') then FOnReadCode (fgLabCode.Text);
    
      TfgAnimationHelper.HideForm (Self, [TfgAnimationOption.ReleaseOnFinish]);
      FCamera: = nil;
    end;

    fgBarcodeScanDetected  and TfgAnimationHelper.HideForm both are called asynchronously. 

    TfgAnimationHelper.HideForm with TfgAnimationOption.ReleaseOnFinish flag should not be allowed to call more than once, otherwise it will lead to double destruction of the form and memory corruption.

     

      Hello, thanks for you reply. Closeform is called only once, either when detecting the barcode if the automatic closing flag is set or if the accept button of the form is pressed. Anyway, I add the verification that it tells me.

  4. Hello, Delphi version is 10.4.1, ReturnOkCodigo makes a http request to a rest service to retrive product info and fill a CollectionView, but as I said  if I call by button click the code CloseForm(true) there is no problem, the problem is when is executed on fgBarcodeScanDetected event.

     

    error_events.txt

  5. Hello, to search and display information about a product I have the following scenario:

    - a form from where a form is opened with a preview camera and a barcode scanner component:

                  FCamera: = TFCamera.Create (nil);
                  FCamera.OnReadCode: = ReturnOkCodigo;
                  TfgAnimationHelper.ShowForm (FCamera);


    - in the form where the image is captured and scanned, I have an accept button that executes this CloseForm (true) code:

     

    procedure TFCamera.CloseForm (OK: boolean);
    begin
      if OK and Assigned (FOnReadCode) and (fgLabCode.Text <> '-') then FOnReadCode (fgLabCode.Text);
    
      TfgAnimationHelper.HideForm (Self, [TfgAnimationOption.ReleaseOnFinish]);
      FCamera: = nil;
    end;


     The FOnReadCode event helps me to retrieve the code that has been read. This works fine executing like this on click button : CloseForm(true); , but if I use a configuration flag (TConfig.JO.B ['closeonread']) to close the form automatically when a barcode is identified, with this code, a memory error occurs (attach log file):

    procedure TFCamera.fgBarcodeScanDetected (Sender: TObject;
      const ABarcodes: TArray <FGX.Scanner.Barcode.TfgBarcode>);
    begin
     fgLabCode.Text: = ParseaCodigo (ABarcodes [0] .RawData); //. SubString (HOST_FULL.Length);
     if TConfig.JO.B ['closeonread'] then CloseForm (true) else
      begin
       TThread.ForceQueue (nil, procedure begin
        fgBarcodeScan.Active: = False;
       end);
      end;
    end;

     

    error_camera_scan_01.png

    error_camera_scan_02.png

    error_camera_preview.txt

  6. Hello the error raise in this line from th Select procedure (I notice that this method is called twice when I click a menu option, maybe some check to avoid it could be interesting):

    procedure TfgListMenuSelectionController.Select(const AItemIndex: Integer);
    var
      Item: TfgListMenuItem;
    begin
      TfgAssert.IsNotNil(FSelection, 'FSelection');
      TfgAssert.IsNotNil(FListMenu, 'FListMenu');
      TfgAssert.InRange(AItemIndex, 0, FListMenu.Items.Count - 1); <--  HERE ERROR IS RAISED ¡
    
      if Mode = TfgListMenuSelectionMode.None then
        Exit;
    
      BeginUpdate;
      try
        Item := FListMenu.Items.ByIndex[AItemIndex];
        if Item.Selectable and not FSelection.Contains(Item) then
        begin
          if Mode = TfgListMenuSelectionMode.SingleSelect then
            ResetSelection;
    
          Item.IsSelected := True;
          FSelection.Add(Item);
          FIsSelectionChanged := True;
        end;
      finally
        EndUpdate;
      end;
    end;

     Also it seems that fgMainMenu.Index:= 0; don't help to change the current selected item. The small demo I say before it works fine was because the create menus procedure was called from a button, if I call the procedure from a menu option the error is raised, I think I understand this error: maybe the sequence:

    - tap menu option

    - call OnTap menu option --> create menu items

    - Select procedure is called but with a wrong index (6 in this case).

    cause the problem, so Select should occur before OnTap, or the Items.Clear should reset the index to 0 (or unselectd -1). Other solutions could be no calling Select procedure, because I don't do it . Attached the small demo, iy fou push the button it works, if you push menu item item (login or logout options) it falls when change from 6 6 to 3 menu options.

    Thanks

    CreateMenu.rar

    • Like 1
  7. Hello Yaroslav, I've done a small program with the same code to generate the menu options and it works, but the original continues with the same issue. This is the log, I don't know it it will help you :

     

    2020-08-10 14:07:49.542 2003-2003/mpl.kt.keeptrack D/debug: [FlexBox]: recalculated Layout: name="mainDrawer", class="TfgDrawer", duration="2 msec"
    2020-08-10 14:07:49.546 2003-2003/mpl.kt.keeptrack E/error: The current value [6] is not in range [0, 2]. 
    2020-08-10 14:07:49.628 2003-2003/mpl.kt.keeptrack E/error: The current value [6] is not in range [0, 2].  
    2020-08-10 14:07:49.628 2003-2003/mpl.kt.keeptrack E/error: The current value [6] is not in range [0, 2].  
    2020-08-10 14:07:49.666 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onViewRecycled
    2020-08-10 14:07:49.671 2003-2003/mpl.kt.keeptrack I/chatty: uid=10226(mpl.kt.keeptrack) identical 5 lines
    2020-08-10 14:07:49.673 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onViewRecycled
    2020-08-10 14:07:49.673 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onBindViewHolder
    2020-08-10 14:07:49.677 2003-2003/mpl.kt.keeptrack I/chatty: uid=10226(mpl.kt.keeptrack) identical 1 line
    2020-08-10 14:07:49.679 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onBindViewHolder
    2020-08-10 14:08:11.352 2003-2070/mpl.kt.keeptrack D/OpenGLRenderer: endAllActiveAnimators on 0xcca3e780 (RippleDrawable) with handle 0xccc837c0
    2020-08-10 14:08:11.373 2003-2003/mpl.kt.keeptrack A/fatal: [Java bridge]: cannot remove JNIObject. Delphi listener object are not registered. instance=CCAA6220
    2020-08-10 14:08:21.440 2003-2003/mpl.kt.keeptrack D/debug: [FlexBox]: recalculated Layout: name="", class="TfgButton", duration="0 msec"
    2020-08-10 14:08:21.446 2003-2003/mpl.kt.keeptrack D/debug: [FlexBox]: recalculated Layout: name="", class="TfgButton", duration="0 msec"
    2020-08-10 14:08:21.449 2003-2003/mpl.kt.keeptrack D/debug: [FlexBox]: recalculated Layout: name="", class="TfgLabel", duration="0 msec"
    2020-08-10 14:08:21.460 2003-2003/mpl.kt.keeptrack D/debug: [FlexBox]: recalculated Layout: name="", class="TfgEdit", duration="0 msec"
    2020-08-10 14:08:21.462 2003-2003/mpl.kt.keeptrack D/debug: [FlexBox]: recalculated Layout: name="", class="TfgLabel", duration="0 msec"
    2020-08-10 14:08:21.467 2003-2003/mpl.kt.keeptrack D/debug: [FlexBox]: recalculated Layout: name="", class="TfgEdit", duration="0 msec"
    2020-08-10 14:08:21.468 2003-2003/mpl.kt.keeptrack D/debug: [FlexBox]: posted request on realign: root="FLogin: TFLogin", initiator="FLogin: TFLogin"
    2020-08-10 14:08:21.482 2003-2003/mpl.kt.keeptrack D/debug: [FlexBox]: recalculated Layout: name="FLogin", class="TFLogin", duration="1 msec"
    2020-08-10 14:08:21.483 2003-2003/mpl.kt.keeptrack D/debug: [FlexBox]: posted request on realign: root="FLogin: TFLogin", initiator="FLogin: TFLogin"
    2020-08-10 14:08:21.489 2003-2003/mpl.kt.keeptrack D/debug: [FlexBox]: posted request on realign: root=": TfgMainContent", initiator="FLogin: TFLogin"
    2020-08-10 14:08:21.490 2003-2003/mpl.kt.keeptrack D/debug: [FlexBox]: recalculated Layout: name="", class="TfgMainContent", duration="1 msec"
    2020-08-10 14:08:21.491 2003-2003/mpl.kt.keeptrack D/debug: [FlexBox]: recalculated Layout: name="", class="TfgMainContent", duration="1 msec"
    2020-08-10 14:08:21.509 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onViewRecycled
    2020-08-10 14:08:21.510 2003-2003/mpl.kt.keeptrack I/chatty: uid=10226(mpl.kt.keeptrack) identical 1 line
    2020-08-10 14:08:21.511 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onViewRecycled
    2020-08-10 14:08:21.511 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onBindViewHolder
    2020-08-10 14:08:21.513 2003-2003/mpl.kt.keeptrack I/chatty: uid=10226(mpl.kt.keeptrack) identical 1 line
    2020-08-10 14:08:21.514 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onBindViewHolder
    2020-08-10 14:08:22.744 2003-2003/mpl.kt.keeptrack D/debug: [FlexBox]: recalculated Layout: name="mainDrawer", class="TfgDrawer", duration="0 msec"
    2020-08-10 14:08:22.745 2003-2003/mpl.kt.keeptrack D/debug: [FlexBox]: recalculated Layout: name="", class="TfgMainContent", duration="1 msec"
    2020-08-10 14:08:22.759 2003-2003/mpl.kt.keeptrack A/fatal: [Java bridge]: cannot remove JNIObject. Delphi listener object are not registered. instance=CCAA6A18
    2020-08-10 14:08:22.765 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onViewRecycled
    2020-08-10 14:08:22.766 2003-2003/mpl.kt.keeptrack I/chatty: uid=10226(mpl.kt.keeptrack) identical 1 line
    2020-08-10 14:08:22.767 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onViewRecycled
    2020-08-10 14:08:22.767 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onBindViewHolder
    2020-08-10 14:08:22.777 2003-2003/mpl.kt.keeptrack I/chatty: uid=10226(mpl.kt.keeptrack) identical 4 lines
    2020-08-10 14:08:22.778 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onBindViewHolder
    2020-08-10 14:08:22.780 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onCreateViewHolder
    2020-08-10 14:08:22.786 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onBindViewHolder
    2020-08-10 14:08:29.927 2003-2003/mpl.kt.keeptrack D/debug: [FlexBox]: recalculated Layout: name="mainDrawer", class="TfgDrawer", duration="1 msec"
    2020-08-10 14:08:29.929 2003-2003/mpl.kt.keeptrack E/error: The current value [6] is not in range [0, 2]. 
    2020-08-10 14:08:29.930 2003-2003/mpl.kt.keeptrack E/error: The current value [6] is not in range [0, 2].  
    2020-08-10 14:08:29.930 2003-2003/mpl.kt.keeptrack E/error: The current value [6] is not in range [0, 2].  
    2020-08-10 14:08:29.942 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onViewRecycled
    2020-08-10 14:08:29.947 2003-2003/mpl.kt.keeptrack I/chatty: uid=10226(mpl.kt.keeptrack) identical 5 lines
    2020-08-10 14:08:29.948 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onViewRecycled
    2020-08-10 14:08:29.948 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onBindViewHolder
    2020-08-10 14:08:29.952 2003-2003/mpl.kt.keeptrack I/chatty: uid=10226(mpl.kt.keeptrack) identical 1 line
    2020-08-10 14:08:29.954 2003-2003/mpl.kt.keeptrack D/NativeListViewAdapter: onBindViewHolder
    2020-08-10 14:08:34.521 2003-2070/mpl.kt.keeptrack D/OpenGLRenderer: endAllActiveAnimators on 0xccd04f80 (RippleDrawable) with handle 0xccc83850
    2020-08-10 14:08:34.539 2003-2003/mpl.kt.keeptrack A/fatal: [Java bridge]: cannot remove JNIObject. Delphi listener object are not registered. instance=CCAA5848

     

  8. Hello Yaroslav, I've download the 1.4.3.0 version and it seems the problem persists, here is the code I use to create the menu options:

    procedure TFormMain.LoadMenus;
    var
     MenuItem: TfgListMenuItem;
    begin
     fgMainMenu.BeginUpdate;
     fgMainMenu.Index:= 0; //added this trying to fix the problem
     fgMainMenu.Items.ClearAndResetID;
    
     if TConfig.Loged then
      begin
       MenuItem:= fgMainMenu.Items.Add as TfgListMenuItem;
       MenuItem.Title:= 'Entradas';
       MenuItem.Style:= TfgMenuItemStyle.PrimaryItem;
       MenuItem.IconName:= R.Bitmap.ENTRA;
       MenuItem.OnTap:= MenuEntra;
    
       MenuItem:= fgMainMenu.Items.Add as TfgListMenuItem;
       MenuItem.Title:= 'Salidas';
       MenuItem.Style:= TfgMenuItemStyle.PrimaryItem;
       MenuItem.IconName:= R.Bitmap.SALE;
    
       MenuItem:= fgMainMenu.Items.Add as TfgListMenuItem;
       MenuItem.Title:= 'Stock';
       MenuItem.Style:= TfgMenuItemStyle.PrimaryItem;
       MenuItem.IconName:= R.Bitmap.STOCK;
    
       MenuItem:= fgMainMenu.Items.Add as TfgListMenuItem;
       MenuItem.Title:= 'Datos palet';
       MenuItem.Style:= TfgMenuItemStyle.PrimaryItem;
       MenuItem.IconName:= R.Bitmap.INFO;
    
       MenuItem:= fgMainMenu.Items.Add as TfgListMenuItem;
       MenuItem.Title:= '';
       MenuItem.Style:= TfgMenuItemStyle.Divider;
    
       MenuItem:= fgMainMenu.Items.Add as TfgListMenuItem;
       MenuItem.Title:= 'Ajustes';
       MenuItem.Style:= TfgMenuItemStyle.PrimaryItem;
       MenuItem.IconName:= R.Bitmap.AJUSTES;
       MenuItem.OnTap:= MenuAjustes;
    
       MenuItem:= fgMainMenu.Items.Add as TfgListMenuItem;
       MenuItem.Title:= 'Salir';
       MenuItem.Style:= TfgMenuItemStyle.PrimaryItem;
       MenuItem.IconName:= R.Bitmap.SALIR;
       MenuItem.OnTap:= MenuLogout;
      end else
      begin
       MenuItem:= fgMainMenu.Items.Add as TfgListMenuItem;
       MenuItem.Title:= 'Validar';
       MenuItem.Style:= TfgMenuItemStyle.PrimaryItem;
       MenuItem.IconName:= R.Bitmap.LOGIN;
       MenuItem.OnTap:= MenuLogin;
    
       MenuItem:= fgMainMenu.Items.Add as TfgListMenuItem;
       MenuItem.Title:= '';
       MenuItem.Style:= TfgMenuItemStyle.Divider;
    
       MenuItem:= fgMainMenu.Items.Add as TfgListMenuItem;
       MenuItem.Title:= 'Ajustes';
       MenuItem.Style:= TfgMenuItemStyle.PrimaryItem;
       MenuItem.IconName:= R.Bitmap.AJUSTES;
       MenuItem.OnTap:= MenuAjustes;
      end;
    
     fgMainMenu.EndUpdate;
    end;

    Thank you.

  9.  Hello, I've two app options that change the menu items displayed on TfgListMenu, and I clear the list when app option change and create - add (3 or 6 menuitems), when I do the change from 6 to 2 I get this error message: "The current value [5] is not in range [0,2]", I imagine that is something related to item selected, but I don't know how to fix it, thanks.

     

×
×
  • Create New...