Cyknight Posted March 6, 2021 Share Posted March 6, 2021 10 hours ago, zaphod said: Why is there a icons-old folder? What is it used for? No idea, not normally used. I could hazard a guess and say it may be something for drivers with multiple feedback icons to retain a last 'state' icon for loading or maybe dumping unused status icon (ie maybe the RGB light experience driver or a shade driver that has multiple selectable options for 'types') but that is indeed just guess work. 10 hours ago, zaphod said: And the device_lg and device_sm icons - are these just used by Composer or are they used anywhere else as well? Just composer. Quote Link to comment Share on other sites More sharing options...
zaphod Posted March 6, 2021 Author Share Posted March 6, 2021 Have a look inside the experience-button-scenario.c4z file that is in the C4 drivers file library. There is a www/icons folder and a www/icons-old folder. Quote Link to comment Share on other sites More sharing options...
RyanE Posted March 6, 2021 Share Posted March 6, 2021 1 hour ago, zaphod said: Have a look inside the experience-button-scenario.c4z file that is in the C4 drivers file library. There is a www/icons folder and a www/icons-old folder. Likely the developer just renamed the /icons folder into /icons-old, and then put a new set of icons into /icons. If they're not referred to in the .xml portion of the driver, they're not used by the experience button and could likely be deleted. RyanE Quote Link to comment Share on other sites More sharing options...
zaphod Posted March 7, 2021 Author Share Posted March 7, 2021 I have written the python code that totally automates this process and things were looking good. I thought I did everything correctly but C4 doesn't want to accept my c4z files. It says Quote Unable to add driver. Reason: Broker: WebException I am not sure what this means? Maybe it doesn't like some of the parsing that I am doing in the XML file. I seem to have all of the correct files in the correct directory structure. Anyone know what this means? Quote Link to comment Share on other sites More sharing options...
msgreenf Posted March 7, 2021 Share Posted March 7, 2021 Share your xml Quote Link to comment Share on other sites More sharing options...
zaphod Posted March 7, 2021 Author Share Posted March 7, 2021 Here is the top of the file which is the odriver.xmlnly part that I have altered. In this instance I am attempting to make a new driver using the Rolling Stones lips logo as the icon. <devicedata> <!-- If you are making your own driver then change the details below. Note the date is in US format: Month/Day/Year --> <name>stones</name> <model>Scenario</model> <creator>Control4</creator> <created>03/07/2021 15:44</created> <modified>03/07/2021 15:44</modified> <!-- Each time you modify the driver update the version number below. --> <version>12</version> <!-- Modify the path in the display_icons section to match the name of your driver. So if you saved this driver as scenario-party-time.c4z replace stones with scenario-party-time Ensure you also add your own png icons to the icons/device folder named default_300.png, default_90.png and default_70.png Also add selected state icons as selected_300.png, selected_90.png and selected_70.png --> <capabilities> <navigator_display_option proxybindingid="5001"> <display_icons> <Icon height="90" width="90">controller://driver/stones/icons/device/default_90.png</Icon> <Icon height="70" width="70">controller://driver/stones/icons/device/default_70.png</Icon> <Icon height="300" width="300">controller://driver/stones/icons/device/default_300.png</Icon> <Icon height="512" width="512">controller://driver/stones/icons/device/default_512.png</Icon> <Icon height="1024" width="1024">controller://driver/stones/icons/device/default_1024.png</Icon> <state id="Default"> <Icon width="70" height="70">controller://driver/stones/icons/device/default_70.png</Icon> <Icon width="90" height="90">controller://driver/stones/icons/device/default_90.png</Icon> <Icon width="300" height="300">controller://driver/stones/icons/device/default_300.png</Icon> <Icon width="512" height="512">controller://driver/stones/icons/device/default_512.png</Icon> <Icon width="1024" height="1024">controller://driver/stones/icons/device/default_1024.png</Icon> </state> <state id="Selected"> <Icon width="70" height="70">controller://driver/stones/icons/device/selected_70.png</Icon> <Icon width="90" height="90">controller://driver/stones/icons/device/selected_90.png</Icon> <Icon width="300" height="300">controller://driver/stones/icons/device/selected_300.png</Icon> <Icon width="512" height="512">controller://driver/stones/icons/device/selected_512.png</Icon> <Icon width="1024" height="1024">controller://driver/stones/icons/device/selected_1024.png</Icon> </state> </display_icons> </navigator_display_option> </capabilities> Attached is the 90 pixel version of the file. Maybe another possiblity is that it doesn't like the png file. I also attached the entire c4z file. stones.c4z Quote Link to comment Share on other sites More sharing options...
msgreenf Posted March 7, 2021 Share Posted March 7, 2021 Nothing jumps out as wrong Quote Link to comment Share on other sites More sharing options...
zaphod Posted March 7, 2021 Author Share Posted March 7, 2021 I am going to try to just rebuild the unzipped original experience-button-scenario.c4z driver and then change things one at a time until I see what breaks. Quote Link to comment Share on other sites More sharing options...
zaphod Posted March 10, 2021 Author Share Posted March 10, 2021 I have got this working now. I have created a python script that takes an image file and creates a button with a custom icon and inserts it into a c4z driver file. It also alters the XML file. I will probably start a new thread on this, but here is a screenshot to show a few examples. The red and black Rolling Stones logos show a default and selected version of a button. Anybody else want to try it out? Quote Link to comment Share on other sites More sharing options...
indecision Posted March 10, 2021 Share Posted March 10, 2021 That is great stuff I have been asking C4 to create a tool to do this for a while. Would love to give it a try. Quote Link to comment Share on other sites More sharing options...
zaphod Posted March 10, 2021 Author Share Posted March 10, 2021 I have uploaded the python script to github https://github.com/zaphodb65/C4driverbuilder Neo1738 1 Quote Link to comment Share on other sites More sharing options...
Neo1738 Posted March 10, 2021 Share Posted March 10, 2021 Great work and thank you! Can't wait to try this out. Quote Link to comment Share on other sites More sharing options...
dinom Posted March 10, 2021 Share Posted March 10, 2021 Is Composer Pro needed to implement this? Quote Link to comment Share on other sites More sharing options...
zaphod Posted March 10, 2021 Author Share Posted March 10, 2021 This script produces a new .c4z drver file. You need Composer Pro to add that to your system. If there are potentially a few different buttons that you might want I would suggest generating a few different drivers with this script and then have your dealer install the drivers. Your dealer should be able to do this remotely in about two minutes. Quote Link to comment Share on other sites More sharing options...
dinom Posted March 10, 2021 Share Posted March 10, 2021 Thanks, does this work for any .c4z drivers or just custom/experience buttons? Quote Link to comment Share on other sites More sharing options...
zaphod Posted March 10, 2021 Author Share Posted March 10, 2021 This just works to generate custom/experience buttons. In theory you should be able to change the icons in any driver by swapping out the image files used for the icons and the references to them. But I didn't want to be playing around with that in case it screws something up. The code on github has a link to a youtube video that shows the process in detail if you want to give it a try. Quote Link to comment Share on other sites More sharing options...
dinom Posted March 10, 2021 Share Posted March 10, 2021 Thanks again, great work! Quote Link to comment Share on other sites More sharing options...
South Africa C4 user Posted March 10, 2021 Share Posted March 10, 2021 Sounds great! Thanks @zaphod Quote Link to comment Share on other sites More sharing options...
RussellB Posted January 3, 2022 Share Posted January 3, 2022 Hi, I had to change line 77 in order to get this to work with the current version of the driver: fin = open(file_name, "rt", errors="ignore") Some extended characters were added into the description, custom quotes around "ON" and "OFF": Driver Properties Driver Version: Current driver version. Current State: Current State of the Experience Button (On, Off) On Name: The text value to display on list navigators when the experience button is set to “On”. Off Name: The text value to display on list navigators when the experience button is set to “Off”. Toggle State Each Time Selected: Toggle the state of the experience button when selected from a navigator (Yes), or do not toggle when selected (No). On LED Color: The color to set a bound keypad button’s LED to when the experience button is set to “On” (Selected). Off LED Color: The color to set a bound keypad button’s LED to when the experience button is set to “Off” (Default). Rich-text character formatting that was preventing the read from succeeding. RussellB Ugh.. need to make some additional fixes because the OUTPUT XML was then not UTF8. So I'm fixing the character set issue and defaulting to creating a driver called "uibutton_" + the name of the image. I'll post a link to my github with the updated script. Quote Link to comment Share on other sites More sharing options...
RussellB Posted January 4, 2022 Share Posted January 4, 2022 I've forked a branch of the python code here:https://github.com/EnsignRutherford/C4driverbuilder This version has added error handling, proper character conversion, and saves the final driver as "uibutton_<image name>.c4z", e.g. uibutton_christmas.c4z. I also added a Windows batch file to call, 'build.bat.' Still doing some tweaking, like the batch file can process all images in a folder and create drivers for all of them. I have some free time. zaphod 1 Quote Link to comment Share on other sites More sharing options...
RAV Posted January 4, 2022 Share Posted January 4, 2022 18 minutes ago, RussellB said: I've forked a branch of the python code here:https://github.com/EnsignRutherford/C4driverbuilder This version has added error handling, proper character conversion, and saves the final driver as "uibutton_<image name>.c4z", e.g. uibutton_christmas.c4z. I also added a Windows batch file to call, 'build.bat.' Still doing some tweaking, like the batch file can process all images in a folder and create drivers for all of them. I have some free time. FYI, there's another similar project Experience Button Generator:https://dnosys.com/ Quote Link to comment Share on other sites More sharing options...
zaphod Posted January 4, 2022 Author Share Posted January 4, 2022 1 hour ago, RussellB said: I've forked a branch of the python code here:https://github.com/EnsignRutherford/C4driverbuilder This version has added error handling, proper character conversion, and saves the final driver as "uibutton_<image name>.c4z", e.g. uibutton_christmas.c4z. I also added a Windows batch file to call, 'build.bat.' Still doing some tweaking, like the batch file can process all images in a folder and create drivers for all of them. I have some free time. Good job! Does the batch file take the same parameters as the original python program - the unselected and selected image files? Quote Link to comment Share on other sites More sharing options...
RussellB Posted January 4, 2022 Share Posted January 4, 2022 24 minutes ago, zaphod said: Good job! Does the batch file take the same parameters as the original python program - the unselected and selected image files? build "name of default image" will build the driver. if the "_selected" image is also in the folder it will be used otherwise ignored. build without any parameter will build drivers for all the default images (non '_selected') and again use the _selected image if its there. I'm still doing some error handling and cleanup, but I just built 6 controls in one shot with it and it works great. The programming behind the buttons is a little more elaborate. They act like radio buttons as only one can be selected at a time. If you deselect any button other than Normal Normal becomes enabled. I think I'll rename it to Everyday or something like that. Get the idea? Quote Link to comment Share on other sites More sharing options...
zaphod Posted January 4, 2022 Author Share Posted January 4, 2022 1 hour ago, RAV said: FYI, there's another similar project Experience Button Generator:https://dnosys.com/ This is actually way better than what I wrote with one exception - for some reason he does not automatically create the c4z file, you have to do that manually. Quote Link to comment Share on other sites More sharing options...
RussellB Posted January 4, 2022 Share Posted January 4, 2022 37 minutes ago, zaphod said: This is actually way better than what I wrote with one exception - for some reason he does not automatically create the c4z file, you have to do that manually. All roads lead to Munich. I will be tweaking it over the next couple of days. I posted an update to the build.bat to check if the required python packages are installed and if not install them. Also the program now auto-downloads the template c4z file and deletes it afterwards. I was annoyed to have to say no to overwriting the experience file every time I copied them to the Drivers folder. I'm going to make a major change to update an EXISTING c4z if found. So let's say you change the Christmas tree icons. If found in the same folder it will update the version as well so it can be upgraded easily. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.