The IDE Tab Bar’s ‘Models’ tab allows you to select a model (application software) to work on, whether it is currently in development, has been created as factory firmware, or has already gone into production and is being updated. Models you have worked on in the past but are not currently developing are listed here too.
Clicking on ‘Models’ presents a list in the Workspace area of all your models:
A drop-down menu allows you to quickly filter the list by model type: all, development, production, factory or inactive:
If you are not an Electric Imp customer, you will not see the production and factory options as you do not have the privileges to promote development models for use in production or as factory firmware. When you select a shared account, your access to the ‘Models’ tab’s various model filters will depend on the role you have been assigned by the shared account’s owner or one its Administrators. Even if you have production privileges for your own account, you will not necessarily have the same privileges for a shared account, and vice versa.
Each model is listed by name, type, the number of device assigned to it, and the date and time at which it was last revised. Clicking on any of these column titles will immediately sort the list by that column, initially alphabetically, lowest to highest, or most recent to oldest, depending on which column you select. Click on a heading again to reverse the sort order.
When you move your mouse pointer over a model, the fifth column, ‘Actions’, will display icons representing actions you can take on that model:
The possible icons represent:
To see which specific devices have been assigned to a model, select that model’s code and then click on the ‘Device’ drop-menu beneath the model’s name in the Workspace.
Models with development devices assigned to them, or those which have been promoted to production, are considered to be ‘active’. All of your models start out as development models. As such they can only be assigned to your development devices.
If you become an Electric Imp customer, you will be able to promote a development model to production. This allows the model’s code to be deployed to production devices on the assembly line and in the field. Development models may also be marked as factory firmware, for use in the factory to prepare production devices for end-use. Again, this functionality is limited to Electric Imp customers.
Models which have no development device associated with them are considered to be ‘inactive’. Not only are they not running on a device, but their agent code is not running in the impCloud™ either. Models that have been promoted to production will not appear under ‘Inactive Models’ even if they have no development devices assigned to them.
To create a new model, just click the large plus sign at the top right of the Workspace.
You will now be presented with a panel which gives you the opportunity to name the new model and assign any of your development devices to it, whether they have yet to be assigned to a model, or are currently assigned to a different one:
New models created this way and which are not immediately assigned to a development device will appear in the Model Navigator’s ‘Inactive Models’ section, and the Workspace will be loaded with the new model’s as-yet-empty agent and device code listings, ready for you to start writing.
If you wish to assign the new model to one of your devices, the ‘Create New Model’ panel lists all your development devices, and you can easily select the one or ones you want to be assigned to the new model you’ll make when you hit the panel’s ‘Create Model’ button. If you have selected a shared account, the ‘Create New Model’ panel will list you unassigned devices but only those devices assigned to the shared account’s models. Some of these may be yours if you have previously assigned any of your development devices to any of this shared account’s models, or they may belong to other collaborators on this shared model.
Move your mouse pointer to the model whose name you wish to change and click on the gearwheel icon ()in the ‘Actions’ column. This calls up the ‘Model Settings’ panel, which allows you to update the name of the model:
The ‘Model Settings’ panel is also used to set a model to be used as factory firmware. The ‘Factory Firmware’ checkbox is only available to Electric Imp customers and other users with production privileges for shared accounts.
The IDE provides plenty of storage for your models, be they active or inactive. Sometimes, though, you want to delete a model to reduce clutter on the screen or because it contained exploratory code you no longer need. You can only delete inactive models — those models with no development devices assigned to them and which have never been promoted to production.
To delete a model, move your mouse pointer to the model whose name you wish to change and click on the gearwheel icon () in the ‘Actions’ column. This calls up the ‘Model Settings’ panel. Because the model is inactive, the panel now includes a ‘Delete Model’ button:
Click on ‘Delete Model’ and the IDE will first ask you to confirm that you do indeed want to delete the model:
Deleted models are lost and can’t be retrieved, so think very carefully before confirming your wish to delete one.
To access a model’s program code, click on the code icon () under the ‘Actions’ column. This will present the model’s code in the Workspace:
How you work with your code with your code is discussed in another section.
Models listed under ‘Production Models‘ are those which have at least one build which has been marked as ready for deployment to production devices. Once one of the model’s builds has been so marked — by clicking the ‘Promote’ button presented in the Workspace (see ‘Deploy a New Production Model’), the model will permanently be marked as a production model. A model can only be marked as production ready by promoting one of its builds. It can’t be deleted and even if it has no development devices assigned to it, it will never appear in the ‘Inactive Devices’ list. There is no way to move a production model back into development-only status.
When you use the Electric Imp mobile app to add a development device to your account, the device is initially ‘unassigned’. This means it has not yet been assigned to a model. Your devices can be viewed by clicking on the devices Top Bar button (look for the chip icon). This item may have a number appended; this is the number of unassigned devices associated with your account.
Clicking on the devices button presents a list of devices in the Workspace:
To find an unassigned device, click on the pop-up menu and select ‘Unassigned’:
You use the ‘Device Settings’ panel to assign a device to an existing model: access ‘Device Settings’ by clicking on the settings icon in the ‘Actions’ column for the required device:
You can also use it to create a new model for the device to run. If you wish to create a new model, click on the ‘New Model’ radio button and enter the new model’s name:
Click on ‘Save Changes’ to make sure your choices are retained, or click on the circled white ‘X’ to close the panel and leave your device’s assignment unchanged.
If you wish to start work on a model without assigning a device to it just yet, click on the new model button in the list presented by the ‘Models’ tab.
A device may only be associated with one model — it can only run one program at any one time, after all — but a single model may be associated with multiple devices because you may need to test it in all the possible circumstances in which your device hardware may be placed.
Only development devices are accessible in this part of the IDE, ie. devices added to your account with the Electric Imp app (Public impCloud) or your own development BlinkUp app (Private impCloud).
The ‘Device Settings’ panel allows you to give a device a more friendly name, but only when you also associate it with a model, whether an existing one or a new one (or it is already associated with a model):
If know the model to which a development device has been assigned, you can view the model’s code and look at the space under the code listings. You’ll see a list of the model’s assigned devices, next to each of which is a gearwheel icon () — click on this to open the device’s own ‘Device Settings’ panel:
Alternatively, you can click on the devices button in the Top Bar, as described above, or you can enter the device’s name (or part of it) into the Tab Bar’s Search panel and hit Return/Enter or click on the magnifying glass icon. This will pop up a list of devices whose names encompass the search string. Locate the one you want and click on the settings icon to the right of its name to call up its ‘Device Settings’ panel:
To return a device to an unassigned state, open its ‘Device Settings’ and click on ‘Delete Device’. The IDE will present a warning, but if you click on OK, the device will be removed from the IDE. When you next use the Electric Imp app (Public impCloud) or your own development app (Private impCloud) to configure the device and add it to your account using BlinkUp, it will once again appear in your ‘Unassigned Devices’ list.