Jump to content

GerhardV

uniGUI Subscriber
  • Posts

    385
  • Joined

  • Last visited

  • Days Won

    27

Everything posted by GerhardV

  1. I use a UnimHTMLFrame and below is the HTML for it: <section id="container" class="container"> <div class="controls"> <fieldset class="input-group"> <button class="start x-button" style="height: 32px; width: 150px; color: #fff;">START SCANNING</button> </fieldset> <div class="reader-config-group"> <label> <span>Camera</span> <select name="input-stream_constraints" id="deviceSelection" style="height: 32px;"></select> </label> </div> </div> <div id="result_strip"> <ul class="thumbnails"></ul> </div> <div class="video-center"> <div id="interactive" class="viewport"><video autoplay="true" preload="auto" src=""></video><canvas class="drawingBuffer" width="320" height="240"></canvas><br clear="all"></div> </div> </section> <script src="files/quagga/js/live_w_locator.js" type="text/javascript"></script> In the last line you can see it loads the script "live_w_locator.js". You can get that file from the website as well as the quagga.js file. See the examples. Those files go into your files folder of the server... I have modified the "live_w_locator.js" to do a Ajax call to the UniGUI Server when a code has been scanned successfully. (Note that below is just a snipped from "live_w_locator.js".) ajaxRequest(frmBarcodeScan.UnimHTMLFrame, 'scansuccess', ["barcode="+code])...see below: Quagga.onDetected(function(result) { var code = result.codeResult.code; App.scannedCount ++; if (App.scannedCount < 2) { var $node = null; $node = $('<li><div class="thumbnail"><div class="caption"><h4 class="code"></h4></div></li>'); $node.find("h4.code").html(code); $("#result_strip ul.thumbnails").prepend($node); } else { Quagga.stop(); App.scannedCount = 0; ajaxRequest(frmBarcodeScan.UnimHTMLFrame, 'scansuccess', ["barcode="+code]); } }); scannedCount is a variable I introduced as to how many scans must be done before it stops and send the array of values back. Just remember you have to use https as for the camera access to work. Here is a few images:
  2. I use barcode scanning in a mobile Asset Verification application. Have a look at quaggaJS. It is a JS library so easy to integrate with UniGUI and no need for 3rd party apps, it is also free. https://serratus.github.io/quaggaJS/ Cheers.
  3. It depends on what the "barcode" means and what you want to do...is not clear from your question but you can also use a REST call and the UniGUIServerModuleHTTPCommand event of TUniServerModule....I use it for reports...see below. procedure TUniServerModule.UniGUIServerModuleHTTPCommand(ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo; var Handled: Boolean); var dm : TdmReportData; begin if ARequestInfo.URI='/report/finsummary' then begin dm := TdmReportData.Create(nil); try dm.qryReport.Connection := dm.FDConnection; AResponseInfo.ContentText := dm.GenerateReportPDF(repFinSummary, '') + ' header [user] = ' + ARequestInfo.RawHeaders.Values['user']; AResponseInfo.ResponseNo := 200; AResponseInfo.WriteContent; Handled := True; finally dm.Free; end; end; end;
  4. By the way Rob - since these are now web apps, you really don't want to go down the road of trapping a key-press event as it will require a trip to the server with every key pressed, for these kind of things it is best to do it on the browser side with JS. It takes some time to get the mindset right but I find myself thinking twice now before just putting some code behind a Delphi event.
  5. Yes that normally happens when there is a mismatch between your app version and the runtime version...just rebuild your app again and make sure it IDE is using the same UniGUI version as the runtime.
  6. Yes that is the idea I had in mind as well. Just need a hook to to execute the necessary JavaScript. But that said...I can completely understand what Farshad is saying as we cannot really continue with the app as it is not stateless and the server needs to know the state of the client to keep track of things. Probably better to write this with Delphi Mobile and then write the "dashboard" with UniGUI.
  7. I have noticed that when I pull the "connection" (switch off) on the client side that it retries connecting to the server. @Farshad is that functionality of UniGUI? I assume so as it is showing a retry counter. If so, is there anyway to trap or intercept that event on the client side? Edit: OK I see on the ServerModule is a ConnectionFailureRecovery property but not sure of a way to attach some JS code when that happens.
  8. Hi citizens of the UniGUI republic! I have a mobile application that will be mostly accessed on tablets via 3G/2G or LTE. It may happen that these signals "disappear" from time to time for short periods which means that the app cannot communicate back to the server when this happens. Now as I understand it, the session still exists on the server as long as the the page didn't get refreshed, correct? Does anybody have any experience or ideas on how to handle this? Is it possible to save the data to "localstorage" or even persist the data via the File-API and then send it later? The data that needs to be send back is a relatively small record, maybe 8-12 fields. It maybe that this ends up being a list of records depending on how long the "offline" will be. The session timeouts will be set accordingly obviously. Any input would be appreciated. Thanks Gerhard.
  9. Do you have the trial version? If so you can not deploy the trial version as it has a session timeout after 3 minutes. Also you would need to install the UniGUI runtime which comes with the subscribed version.
  10. Not sure if this is what you are looking for but maybe have a look at the "OnSessionTimeout" event for TUniMainModule?
  11. GerhardV

    uniTreeView

    http://docs.sencha.com/extjs/4.2.2/#!/api/Ext
  12. Sencha Ext 6 support will be implemented after V1.0 is released...will be one one the first things Farshad said...you can search the forum for that.
  13. I have also found that even the fonts are "slightly" bigger in Firefox.
  14. As the tile says....I can't find anything in the docs explaining it.
  15. Hi Farshad: A while back we had the issue with TTreeView sending back an AjaxEvent even if no event handler has been assigned which causes unnecessary network traffic, which you fixed. I have noticed the same behavior for TUnimNestedList. It fires an OnAjaxEvent every time an item is selected. It does have an OnChange Event which fires just before the OnAjaxEvent, plus other events which should be sufficient. The initial "data" and "load" OnAjaxEvents are fine but the "itemtap" I feel is not necessary?
  16. Yes the plan is to share...but still need to work out a few things with regards to themes....to make it a seamless install.
  17. Yes, I tried them as well as the DLL's from the OpenSSL install (Version 1.0.2.11).
  18. This time I did not break but continued and let it finish...memory leak detected screen attached...This is a standard mobile app created through the wizard...just ran it straight after the creation. Log file also attached. A2017-04-15.zip
  19. Farshad I only see the AV when running from the IDE. When running the exe I do not see the AV...strange.
  20. Oops spoke to soon...just got it on Chrome too after an hour of testing variations (32/64bit...etc.)....could it maybe be because it is mobile? BTW running the latest uniGUI version 1387 on XE7.
  21. This is probably not a uniGUI problem but thought I should still mention it. Not sure why this is happening but I get an AV when SSL is enabled and I shut down the server, but only when the browser is Opera. Works fine on Chrome, Firefox and Edge. Also is fine without SSL. I have created a skeleton project as a test case and I also generated the PEM files as per the uniGUI documentation (and have done it couple of times before). 1. Start the server 2. Open on browser "https://localhost:8077/m" 3. Right click on uniGUI server icon and Shutdown. Below are two images of the code and call stack when I "Break" on the AV message in the IDE. SSL_AccessViolation.zip
×
×
  • Create New...