Pink-El Posted June 3, 2017 Share Posted June 3, 2017 Hello, How to skip login form if param in url exists? Example http://127.0.0.1:8077/m/?barcode=48200125 In this case I do not need login form and I can`t to catch barcode in login form. Thnak you, Dmytro Lendel Link to comment Share on other sites More sharing options...
Pink-El Posted June 3, 2017 Author Share Posted June 3, 2017 I am sorry. I found solution. OnShow event of the login form. Thank you Link to comment Share on other sites More sharing options...
Sherzod Posted June 3, 2017 Share Posted June 3, 2017 Hi, Please look at the demo example \FMSoft\Framework\uniGUI\Demos\Desktop\LoginForm Cookies TUniMainModule.UniGUIMainModuleBeforeLogin Best regards, Link to comment Share on other sites More sharing options...
GerhardV Posted June 3, 2017 Share Posted June 3, 2017 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; Link to comment Share on other sites More sharing options...
Pink-El Posted June 4, 2017 Author Share Posted June 4, 2017 Idea is very simple. I need check barcode in database with mobile device. I found QuickMark application. This application can recognize barcode by camera and open url with value after reading. My application has login form. What I can do in this case? 1 use onShow event of the login form 2 use cookis and hide login form 3 httpcommand of the server module Seems that second way is good solution Thank you, Dmytro Lendel Link to comment Share on other sites More sharing options...
GerhardV Posted June 4, 2017 Share Posted June 4, 2017 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. Link to comment Share on other sites More sharing options...
Pink-El Posted June 4, 2017 Author Share Posted June 4, 2017 Hello, Thank you very much for link. Will check. Dmytro Lendel Link to comment Share on other sites More sharing options...
Pink-El Posted June 4, 2017 Author Share Posted June 4, 2017 Hello, Have you small exmple how to use quagga within UNIGUI? Thank you, Dmytro Lendel Link to comment Share on other sites More sharing options...
GerhardV Posted June 5, 2017 Share Posted June 5, 2017 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: 1 Link to comment Share on other sites More sharing options...
JarekZ Posted June 5, 2017 Share Posted June 5, 2017 Can you show changes in live_w_locator.js ?? Link to comment Share on other sites More sharing options...
JarekZ Posted June 5, 2017 Share Posted June 5, 2017 The camera starts but the code scan unfortunately does not. The green frame around the code also does not exist. Maybe not all files have lost. Can you write more? Link to comment Share on other sites More sharing options...
GerhardV Posted June 6, 2017 Share Posted June 6, 2017 There are many types of Barcodes, you would need to adjust the decoder property array under the state object to cater for the expected types in the live_w_locator.js file. decoder: { readers : ['ean_reader', 'ean_5_reader', 'ean_2_reader', 'code_128_reader'] See the examples on the Quagga website...in which case they have a drop down to select the type but you can pass it in as above. Remember the more you define the longer it might take to recognize it as it has to try all of them. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now