Automatically generated grids and forms
One of the best things in Ozeki is that you can automatically generate forms, and grids for your data classes. If your data is stored in an Item Manager (Lecture 9), you can display a grid and/or a form on the Graphical User Interface of your program automatically with a single line of code.
Create a grid to manage license plates!
The following video shows you how to generate your grid using the previously created data class and item manager through the singleton instance of the AllowedLicensePlateManager class.
Use the managed data in the barrier control code!
If the NumberPlateDetected event has been occured, we need to check whether the detected license can be found in the item manager of the AllowedLicensePlate or not. We can verify it through the count method of the item manager.
Create a data class to store detections!
The following video shows how to create a new data class that will be responsible for storing detected license plates. Use the [OzA_List] attribute to show the columns in the grid.
Create an ItemManager for detections!
From the following video you can learn how to save your data to your storage. In this case, an xml file will be generated in the c:\Program Files\Ozeki\Ozeki10\Data\BarrierControl folder with the DetectedLicense_ prefix. It will keep the license plate number, a timestamp, and a checkbox which shows you that the license plate is allowed or not.
Create a grid to show detections!
Now you need to use the Admin method of the singleton instance of the MyDetectionManager class to show the detected licenses in a list. If you use the OzAdminType.Grid type for the Admin method's parameter, only a list will be generate, without a form. Furthermore you can see how to add the page to the AppSiteMap and to the Toolbar tools.
Save detected license plates to MyDetectionManager!
You need to use the Add method of the MyDetectionManager instance to add the detected license plates to your item manager.
Test your code!
The following video demonstrates the developed barrier control app. You can see that the barrier control system opens the barrier if a car arrives with an allowed license plate number.
- Become a Robot Master
- Build your first App in C#.Net
- Send messages from your C#.Net App to your Lego robot
- Receive messages from your robot and handle events
- Convert a SNAP app into C#
- Build a user interface for multiple robots
- Create a C#.Net version of the Barrier Control App
- Build a responsive user interface for various screen sizes
- Create a data class
- Learn to use an item manager