Jump to content

New StreamDeck Plugin


Recommended Posts

With the F-16 getting the new ECM panel functionality how do you go about getting the lamp status exported? There are some status lights that aren't clickable.I extracted the button clickables as you can see below

 

 

  -- ECM Interface
[455]  = "%.2f", --PTR-ECM-TMB-OPR-455,TUMB,455,-1,-1,1,ECM power switch
[457]  = "%.2f", --PTR-ECM-TMB-XMIT-457,TUMB,457,-1,-1,1,ECM XMIT switch
[456]  = "%.2f", --PTR-ECM-LVR-DIM-456,LEV,456,0,0,1,ECM DIM rotary knob
[458]  = "%.2f", --PTR-ECM-BTN-RESET-458,BTN,458,1,0,1,ECM reset button
[459]  = "%.2f", --PTR-ECM-BTN-BIT-459,BTN,459,1,0,1,ECM bit button
[460]  = "%.2f", --PTR-ECM-BTN-1-460,TUMB,460,-1,0,1,ECM 1 button
[465]  = "%.2f", --PTR-ECM-BTN-2-465,TUMB,465,-1,0,1,ECM 2 button
[470]  = "%.2f", --PTR-ECM-BTN-3-470,TUMB,470,-1,0,1,ECM 3 button
[475]  = "%.2f", --PTR-ECM-BTN-4-475,TUMB,475,-1,0,1,ECM 4 button
[480]  = "%.2f", --PTR-ECM-BTN-5-480,TUMB,480,-1,0,1,ECM 5 button
[485]  = "%.2f", --PTR-ECM-BTN-6-485,TUMB,485,-1,0,1,ECM 6 button
[490]  = "%.2f", --PTR-ECM-BTN-FRM-490,TUMB,490,-1,0,1,ECM FRM button
[495]  = "%.2f", --PTR-ECM-BTN-SPL-495,TUMB,495,-1,0,1,ECM SPL button

Link to comment
Share on other sites

Never mind, I found it although it looks like some kind of fancy commands will have to be created to consolidate the lights into one function as they all have t heir own numbers and won't work on a single button as is.

 

------ECM Lamps

[102]=  "%.1f",   --  ECM Light

[461]=  "%.1f",   --  BTN 1S
[462]=  "%.1f",   --  BTN 1A
[463]=  "%.1f",   --  BTN 1F
[464]=  "%.1f",   --  BTN 1T
[466]=  "%.1f",   --  Btn_2_S
[467]=  "%.1f",   --  Btn_2_A
[468]=  "%.1f",   --  Btn_2_F
[469]=  "%.1f",   --  Btn_2_T
[471]=  "%.1f",   --  Btn_3_S
[472]=  "%.1f",   --  Btn_3_A
[473]=  "%.1f",   --  Btn_3_F
[474]=  "%.1f",   --  Btn_3_T
[476]=  "%.1f",   --  Btn_4_S
[477]=  "%.1f",   --  Btn_4_A
[478]=  "%.1f",   --  Btn_4_F
[479]=  "%.1f",   --  Btn_4_T
[481]=  "%.1f",   --  Btn_5_S
[482]=  "%.1f",   --  Btn_5_A    
[483]=  "%.1f",   --  Btn_5_F
[484]=  "%.1f",   --  Btn_5_T
[486]=  "%.1f",   --  Btn_6_S
[487]=  "%.1f",   --  Btn_6_A
[488]=  "%.1f",   --  Btn_6_F
[489]=  "%.1f",   --  Btn_6_T
[491]=  "%.1f",   --  Btn_FRM_S
[192]=  "%.1f",   --  Btn_FRM_A
[493]=  "%.1f",   --  Btn_FRM_F
[494]=  "%.1f",   --  Btn_FRM_T
[496]=  "%.1f",   --  Btn_SPL_S
[497]=  "%.1f",   --  Btn_SPL_A
[498]=  "%.1f",   --  Btn_SPL_F
[499]=  "%.1f",   --  Btn_SPL_T


Edited by bones1014
  • Like 1
Link to comment
Share on other sites

I need some help setting up the streamdeck XL for the F14B. I basically have everything working atm, but some issues are happening at random.
Issue: On buttons where the image needs to change after press; when i physically press the button on my streamdeck, the button gets pressed ingame instantly. However; the updating of the image on the streamdeck takes about 1 second, during which i cannot press the same button again.
This happens MOST of the time, however i have had it once not happening, until i took off; then the lag set in again.

Any help would be greatly appreciated!

Link to comment
Share on other sites

Hi folks!
Sorry for a strange question, but... am I missing something? I've seen it dozens of times in export scripts and I don't understand it. What's the puprose of writing "%1d" as a format string? To the best of my knowledge (admittedly fragmented!), "1" does nothing there, i.e. "%d" is exactly the same as "%1d". Is there a secret you know and I don't or... or is it really a superfluous "1"?

==============

On 12/24/2021 at 3:38 AM, bones1014 said:

I found it although it looks like some kind of fancy commands will have to be created to consolidate the lights into one function as they all have t heir own numbers and won't work on a single button as is.

------ECM Lamps

Yeah, all you can do is take these "variables" (S, T, F, A) (a.k.a. "IDs" - I call them "variables" for the lack of a better term) and "compose" a string of text out of them, two-line string in this case (with some vertical spacing probably, like "\n\n" or so), then make the string a new exported variable.
I'm not nagging Viper currently and don't have a profile for it (except for basic UFC), but the general idea is the same as I put into the Mirage profile.


It's not a very nice task, because you have to take care of text alignment for a particular font size and shape, SD has only (IIRC) Courier and Courier New monospaced fonts, which look different from what you see in the cockpit (ugly, uncacceptable if you ask me). Other fonts which are similar to fonts used in the cockpit are unfortunately "variable width" (don't know how you call them properly), so you are forced to put strange amount of spaces in between the letters (in your case those S, A, F, T) depending on whether - say - "S" is illuminated or not, so that the letters don't move around too much when S is on or off etc. And if you're not lucky, they WILL move regardless of how hard you try (the space character in a particular font also has some fixed length, which may or may not be the aliquant aliquot of width of the character currently missing in the string).
Oh, and all such annunciations will have to be of the same color, sadly 😞

Maybe Bailey will (or has already?) put his hands on the Viper? See, I've swallowed almost all modules in... 19 months, it's crazy (don't tell my wife, please!), I can't keep up with the pace 🙂

 

==========

On 12/29/2021 at 7:41 PM, SvenNeu said:

However; the updating of the image on the streamdeck takes about 1 second, during which i cannot press the same button again.

I'll be damned if I know the answer and I'll buy a crate of beer for anyone who can tell how to fight the lag. It may be due to the fact that virtually each script exports hundreds of variables, Lua treats the "tables" probably as a kind of "dictionary", so looking up for a specific entry is not as simple as in a "proper" array (of fixed-size elements identified by incremental indices). Then, your variable may be exported in "Every frame arguments" or "Config arguments" (the latter is only 2-3 times per second). And there may be a dozen different reasons for the lag I'm not aware of.


Edited by scoobie

i7-8700K 32GB 2060(6GB) 27"@1080p TM Hawg HOTAS TPR TIR5 SD-XL 2xSD+ HC Bravo button/pot box

Link to comment
Share on other sites

8 hours ago, scoobie said:

Hi folks!
Sorry for a strange question, but... am I missing something? I've seen it dozens of times in export scripts and I don't understand it. What's the puprose of writing "%1d" as a format string? To the best of my knowledge (admittedly fragmented!), "1" does nothing there, i.e. "%d" is exactly the same as "%1d". Is there a secret you know and I don't or... or is it really a superfluous "1"?

Hi Scoobie, I believe it is a superfluous "1", just following the style of the other "%X.Xf" formats. It is valid lua code, as it is just saying an integer decimal that must have at least 1 space. You can try modifying an export script and I believe it should still work.

See lua doc (which is pretty sparse on details), but lua just uses the C language printf format, so more detailed description can be found here.

Link to comment
Share on other sites

On 12/29/2021 at 10:41 AM, SvenNeu said:

However; the updating of the image on the streamdeck takes about 1 second, during which i cannot press the same button again.
This happens MOST of the time, however i have had it once not happening, until i took off; then the lag set in again.

Hey SvenNeu, looking at the F-14B.lua export file, it looks like all functions are running in the "ProcessIkarusDCSConfigHighImportance" function: https://github.com/asherao/DCS-ExportScripts/blob/master/Scripts/DCS-ExportScript/ExportsModules/F-14B.lua#L2096-L2111

You may want to move those to the "ProcessIkarusDCSConfigLowImportance" function and see if that cuts down on some of the bandwidth.

There are a LOT of id's being exported from the module file, you might also want to experiment with deleting some of the exports. I would suggest doing an initial test of deleting all export id's except the one you care about and see if the switch button is reponsive with that setting -- if so, you can go back and do a more selective pruning of export id's.

Link to comment
Share on other sites

On 12/31/2021 at 6:20 PM, scoobie said:

Yeah, all you can do is take these "variables" (S, T, F, A) (a.k.a. "IDs" - I call them "variables" for the lack of a better term) and "compose" a string of text out of them, two-line string in this case (with some vertical spacing probably, like "\n\n" or so), then make the string a new exported variable.

I'm not nagging Viper currently and don't have a profile for it (except for basic UFC), but the general idea is the same as I put into the Mirage profile.


It's not a very nice task, because you have to take care of text alignment for a particular font size and shape, SD has only (IIRC) Courier and Courier New monospaced fonts, which look different from what you see in the cockpit (ugly, uncacceptable if you ask me). Other fonts which are similar to fonts used in the cockpit are unfortunately "variable width" (don't know how you call them properly), so you are forced to put strange amount of spaces in between the letters (in your case those S, A, F, T) depending on whether - say - "S" is illuminated or not, so that the letters don't move around too much when S is on or off etc. And if you're not lucky, they WILL move regardless of how hard you try (the space character in a particular font also has some fixed length, which may or may not be the aliquant aliquot of width of the character currently missing in the string).
Oh, and all such annunciations will have to be of the same color, sadly 😞

Maybe Bailey will (or has already?) put his hands on the Viper? See, I've swallowed almost all modules in... 19 months, it's crazy (don't tell my wife, please!), I can't keep up with the pace 🙂

 

Hey there. So the question is how to represent the status of a number of lights on one single (jammer) button as seen in DCS on the stream deck? If so, that's an interesting problem. Off the top of my head, a solution I would try to do first would use a special character next to the letter to represent its status. Something like a dot (°), or colon (:), or even a pair of vertical bars(| |). Lua can take a lot of odd characters and even emojis, believe it or not!

I don't think text color changes are possible.

Be creative. I'll put this on my exploration list. 👍

Link to comment
Share on other sites

On 12/31/2021 at 3:20 AM, scoobie said:

Yeah, all you can do is take these "variables" (S, T, F, A) (a.k.a. "IDs" - I call them "variables" for the lack of a better term) and "compose" a string of text out of them, two-line string in this case (with some vertical spacing probably, like "\n\n" or so), then make the string a new exported variable.
I'm not nagging Viper currently and don't have a profile for it (except for basic UFC), but the general idea is the same as I put into the Mirage profile.


It's not a very nice task, because you have to take care of text alignment for a particular font size and shape, SD has only (IIRC) Courier and Courier New monospaced fonts, which look different from what you see in the cockpit (ugly, uncacceptable if you ask me). Other fonts which are similar to fonts used in the cockpit are unfortunately "variable width" (don't know how you call them properly), so you are forced to put strange amount of spaces in between the letters (in your case those S, A, F, T) depending on whether - say - "S" is illuminated or not, so that the letters don't move around too much when S is on or off etc. And if you're not lucky, they WILL move regardless of how hard you try (the space character in a particular font also has some fixed length, which may or may not be the aliquant aliquot of width of the character currently missing in the string).
Oh, and all such annunciations will have to be of the same color, sadly 😞

Maybe Bailey will (or has already?) put his hands on the Viper? See, I've swallowed almost all modules in... 19 months, it's crazy (don't tell my wife, please!), I can't keep up with the pace 🙂

 

 

 

Where do you learn how to write in the language required? I don't know where to start. I'd love to contribute to something like this.

Link to comment
Share on other sites

Digging into using the plugin with mods and I tried to use the install path through saved games. The A-4 appears however there isn't a clickabledata.lua file for the script to pull from like all the other official modules. Maybe if this file existed it would work?

image.png

 

*update*

I guess the clickabledata.lua does exist it just doesn't show up when you search for it in windows search. Annoying.


Edited by bones1014
update
Link to comment
Share on other sites

Thank you, @ctytler, for the explanation. I was worried that Lua somehow expands on the classic printf format string syntax as specified in C. If not - great! 🙂

 

Hi, @Bailey!
Yes, all these ideas I sometimes utilize in my ugly profiles for SD, with little modifications.
Instead of || I sometimes use brackets [] (which doesn't matter, of course). For example I have a "gauge" on SD which shows how much fuel I have in tanks in P-51 and which tank is currently selected (otherwise I routinely forget to switch them in flight). I don't have my DCS computer here, so I'll try to mimick it with text. The SD button looks like this:

 89  [82]
    0
 LD   RD

Whichever tank is selected - gets "bracketed" (non-bracketed numbers are instead surrounded by a single space from left and right). In the example above the right wing tank is selected - top right number. Numbers are gallons of fuel, except for left/right droptanks (LD/RD), where there are no probes.
Well, I still sometimes forget to switch tanks, but not so often 🙂

EDIT: I'm an idiot, I swear! It just popped into my mind... In the script you can "measure" the discrepancy in fuel remaining in the left vs. right tank. When it's too big, you may set some other (new) export variable and drive the "Icon State Change" for the button in the SD. For example: no or little fuel imbalance - black icon, big imbalance - yellow icon! Maybe this will prevent me from forgetting to switch tanks.

 

Instead of a degree symbol, there are circles in unicode - full and empty circles, so I sometimes use them where textual descriptions for switch positions are very short, like this (Mirage 2000, bomb arming switch - inert/retarded/instantaneous):

obraz.png

And another idea, though very far from perfect, is to have a uniform black/grey icon with coloured rectangles painted on it in very particular places (it requires painstaking "tuning"). Each coloured rectangle is a specific annunciator, then you COVER some of them with unicode characters which look like full rectangles. Text colour and the underlying icon color must be the same, e.g. the same hue of grey. I have this kind of contraption for Dora's gear/flaps lamps (green, yellow, red). Don't have a screenshot to show it now. The imperfection is that Stream Deck software uses some kind of "contrast enhancement" for text, so if you put text of colour X onto an icon of the same colour X, the borders of characters are somehow changed in colour to become visible. I don't know how to explain that better. So... in case of my Dora gear/flaps lamps, you can still see faint silhouettes of those rectangular unicode charactes. Looks rather bad 😞

The last "patent" is the one I explained somewhere above here. If the backlight in the button is characters, you can simply "print" (as text) those of them which are currently illuminated in the button, and replace with space(s) those that aren't. Say, the button has separate "ABCD" letters, but B and D are currently out, only A and C are illuminated (backlit), so in this case you print "A C " (the spaces substitue the missing B and D). That works too, except for the problems with alignment - spaces aren't always a good replacement for a missing "B" (for example), one space may be - say - 0.65 of a B's width, while two spaces will be 1.30 of it - and the whole string starts jumping left or right. That looks very poor. Oh, and yes - everything in one colour only 😞

 

@bones1014
There's something strange about Lua, or my Google skills aren't good enough - I haven't found a "proper" languge specification for Lua and the only source I'm using (with limited success) is the "manual" here:
http://www.lua.org/manual/5.4/

In certain places this manual tries to look like a specification, but not everywhere. For example it explains what some string function does, but... doesn't say what the function does when the passed arguments are wrong, for example the number of something physical is passed as a negative number etc. I feel a bit lost when I'm reading it.

Now, if you don't know absolutely anything about the language (much like myself, really), the best approach, at least in the hobbyist/amateur realm (as it is the case with DCS for us), is what I call the "monkey approach", i.e. go see how other people wrote something and start tinkering with that, replicate it and modify, like "touch it and see what happens", while at the same time helping yourself with the aforementioned manual. Slowly, step by step, you'll start having those "Eureka!" moments and things will start to click into their proper places. There's nothing to be afraid of, it's not a job, no one's gonna fire you for writing cr*ppy code, no one will yell at you, nor will anybody die because of the bugs you make.

The other piece of good news is that you won't "break" your DCS with bad export script, the only thing that will (silently) crash will be your script. And another good news - if your script crashes, you don't have to re-launch the whole DCS, but only the mission! Quit mission (stay in the debriefing window), Alt-Tab, fix the script, Alt-Tab, "Fly again" and you can test your fixed scipt 🙂
Oh, and more good news - as long as your script doesn't crash, you don't have to leave a mission in order to test new changes in your script. The script is loaded fresh every time you "change aircraft" in the mission (note: it must be a different module! changing from, say, A-10C to A-10C doesn't count as the "change"). So, for working on my export script I'm using a mission with more than one "spawn" aircraft, where one of them is the one I'm working on, and the other (or others) is any other module, preferably a lightweight (simple) one, so it doesn't take too long to load. So now... if you want to modify your script, you change aircraft and go change the script, then go back to DCS and change aircraft again - to the one the script is for. You need to reload the mission only when your script crashes. You know it when your SD profile stops responding, not even a simplest toggle switch works. It means your script had some syntactic error (or some other error) and Lua interpreter bailed out. Fix the script, reload mission.

As for your question regarding A-4E-C... blind guess, but it may be the case that Charlie's plugin looks for clickabledata.lua files in theDCS folder, while the Scooter sits in the "Saved Games" (Sorry, I don't think I understand what you did). Regardless of that, the lack of those ready to use commands in the plugin's window (the one you pasted above) is only a small nuisance - you can still put proper ID's, device numbers etc. manually, digging them out of the clickabledata.lua, devices.lua and mainpanel_init.lua. It's not the greatest fun in life, but it's totally doable and... you only do it once, a few hours of toil and the profile is more or less ready 🙂


Edited by scoobie
  • Thanks 1

i7-8700K 32GB 2060(6GB) 27"@1080p TM Hawg HOTAS TPR TIR5 SD-XL 2xSD+ HC Bravo button/pot box

Link to comment
Share on other sites

5 hours ago, scoobie said:

As for your question regarding A-4E-C... blind guess, but it may be the case that Charlie's plugin looks for clickabledata.lua files in theDCS folder, while the Scooter sits in the "Saved Games" (Sorry, I don't think I understand what you did). Regardless of that, the lack of those ready to use commands in the plugin's window (the one you pasted above) is only a small nuisance - you can still put proper ID's, device numbers etc. manually, digging them out of the clickabledata.lua, devices.lua and mainpanel_init.lua. It's not the greatest fun in life, but it's totally doable and... you only do it once, a few hours of toil and the profile is more or less ready 🙂

 

I think the problem is exactly what you lined out there. I was trying to work around it somehow. I have a list of clickable objects ready to go if we can every use the export script with mods.

Link to comment
Share on other sites

the @scoobie certified "money approach" is how I attained the majority of my lua knowledge. The other parts are filled in by knowledge and helpful people on these forums, the DCS discord, and the Hoggit discord.

Link to comment
Share on other sites

On 12/24/2021 at 11:38 AM, bones1014 said:

Never mind, I found it although it looks like some kind of fancy commands will have to be created to consolidate the lights into one function as they all have t heir own numbers and won't work on a single button as is.

 

------ECM Lamps

...

[192]=  "%.1f",   --  Btn_FRM_A

...

Minor error: [192]=  "%.1f",   --  Btn_FRM_A should be [492]=  "%.1f",   --  Btn_FRM_A
Thank you so much for the arguments!

Really quick:
I had my "eureka moment" right before having to go do something, so you'll have to wait for the full implementation and the partial-profile with the image-behind. Attached is the code in full for the function. The behind-image is below for your exploration. For the blocks to format correctly you must have the Text in the stream deck set to Times New Roman, 16 pt, align bottom, HTML color 0f1620.
For the rest of the buttons it's just a copy/paste drill, exporting the new images, then documentation, etc. Just will take some time.

F16_ECM_frm.jpg
 


More to come later!

Spoiler
function ExportScript.EcmPanel(mainPanelDevice)
	--this is logic for the ECM panel and the associated lights
	--this is designed to be paired with the proper pre-formated image
	--https://en.wikipedia.org/wiki/Block_Elements
	-- 5 of these █ will cover the whole row at Times New Roman 15pt
	-- options for blanking out
		-- left showing |       ████|
		-- right showing|████       |
		-- both showing ||
		-- both hidden|█████|
	
	
	--FRM logic
	local topPattern_FRM
	-- if S and A are both off
	if mainPanelDevice:get_argument_value(491) < 0.5 and mainPanelDevice:get_argument_value(492) < 0.5 then
		topPattern_FRM = "█████"
	--if S is on and A is off
	elseif mainPanelDevice:get_argument_value(491) > 0.5 and mainPanelDevice:get_argument_value(492) < 0.5 then
		topPattern_FRM = "       ████"
	--if S is off and A is off
	elseif mainPanelDevice:get_argument_value(491) > 0.5 and mainPanelDevice:get_argument_value(492) > 0.5 then
		topPattern_FRM = ""
	--if S is off and A is on
	elseif mainPanelDevice:get_argument_value(491) < 0.5 and mainPanelDevice:get_argument_value(492) > 0.5 then
		topPattern_FRM = "████       "
	end
	
	local bottomPattern_FRM
	-- if F and T are both off
	if mainPanelDevice:get_argument_value(493) < 0.5 and mainPanelDevice:get_argument_value(494) < 0.5 then
		bottomPattern_FRM = "█████"
	--if F is on and T is off
	elseif mainPanelDevice:get_argument_value(493) > 0.5 and mainPanelDevice:get_argument_value(494) < 0.5 then
		bottomPattern_FRM = "       ████"
	--if F is off and T is off
	elseif mainPanelDevice:get_argument_value(493) > 0.5 and mainPanelDevice:get_argument_value(494) > 0.5 then
		bottomPattern_FRM = ""
	--if F is off and T is on
	elseif mainPanelDevice:get_argument_value(493) < 0.5 and mainPanelDevice:get_argument_value(494) > 0.5 then
		bottomPattern_FRM = "████       "
	end
	
	ExportScript.Tools.SendData(4001, topPattern_FRM .. "\n\n" .. bottomPattern_FRM)
	
	--1 logic
	local topPattern_1
	-- if S and A are both off
	if mainPanelDevice:get_argument_value(461) < 0.5 and mainPanelDevice:get_argument_value(462) < 0.5 then
		topPattern_1 = "█████"
	--if S is on and A is off
	elseif mainPanelDevice:get_argument_value(461) > 0.5 and mainPanelDevice:get_argument_value(462) < 0.5 then
		topPattern_1 = "       ████"
	--if S is off and A is off
	elseif mainPanelDevice:get_argument_value(461) > 0.5 and mainPanelDevice:get_argument_value(462) > 0.5 then
		topPattern_1 = ""
	--if S is off and A is on
	elseif mainPanelDevice:get_argument_value(461) < 0.5 and mainPanelDevice:get_argument_value(462) > 0.5 then
		topPattern_1 = "████       "
	end
	
	local bottomPattern_1
	-- if F and T are both off
	if mainPanelDevice:get_argument_value(463) < 0.5 and mainPanelDevice:get_argument_value(464) < 0.5 then
		bottomPattern_1 = "█████"
	--if F is on and T is off
	elseif mainPanelDevice:get_argument_value(463) > 0.5 and mainPanelDevice:get_argument_value(464) < 0.5 then
		bottomPattern_1 = "       ████"
	--if F is off and T is off
	elseif mainPanelDevice:get_argument_value(463) > 0.5 and mainPanelDevice:get_argument_value(464) > 0.5 then
		bottomPattern_1 = ""
	--if F is off and T is on
	elseif mainPanelDevice:get_argument_value(463) < 0.5 and mainPanelDevice:get_argument_value(464) > 0.5 then
		bottomPattern_1 = "████       "
	end
	
	ExportScript.Tools.SendData(4002, topPattern_1 .. "\n\n" .. bottomPattern_1)
end

 

 

 


Edited by Bailey
  • Thanks 2
Link to comment
Share on other sites

Beautiful! :clap: Yeah, that's the "cover icon with characters" or "multiple annunciators in one button" thing. However... aren't you, by any chance, getting artifacts such that I get as shown in the attached picture - those greyish outlines? They are actually 100% black "full rectangle" and "empty rectangle" (top row) characters on 100% black bitmap (icon).

I only get such "ghost" outlines on the real (hardware) Stream Deck, they're invisible in Stream Deck software (in Windows). I have no idea where they come from.
(This is Dora gear/flaps - in the picture all are up, hence all 3 red lamps are uncovered.)

artifacts.png


Edited by scoobie

i7-8700K 32GB 2060(6GB) 27"@1080p TM Hawg HOTAS TPR TIR5 SD-XL 2xSD+ HC Bravo button/pot box

Link to comment
Share on other sites

That's amazing! Are you putting this at the end under the Custom Functions heading? I'd like to play with it a bit.

I copy/pasted for the other buttons. Hope that helps. 🙂
 

function ExportScript.EcmPanel(mainPanelDevice)
    --this is logic for the ECM panel and the associated lights
    --this is designed to be paired with the proper pre-formated image
    --https://en.wikipedia.org/wiki/Block_Elements
    -- 5 of these █ will cover the whole row at Times New Roman 15pt
    -- options for blanking out
        -- left showing |       ████|
        -- right showing|████       |
        -- both showing ||
        -- both hidden|█████|
    
    
    --FRM logic
    local topPattern_FRM
    -- if S and A are both off
    if mainPanelDevice:get_argument_value(491) < 0.5 and mainPanelDevice:get_argument_value(492) < 0.5 then
        topPattern_FRM = "█████"
    --if S is on and A is off
    elseif mainPanelDevice:get_argument_value(491) > 0.5 and mainPanelDevice:get_argument_value(492) < 0.5 then
        topPattern_FRM = "       ████"
    --if S is off and A is off
    elseif mainPanelDevice:get_argument_value(491) > 0.5 and mainPanelDevice:get_argument_value(492) > 0.5 then
        topPattern_FRM = ""
    --if S is off and A is on
    elseif mainPanelDevice:get_argument_value(491) < 0.5 and mainPanelDevice:get_argument_value(492) > 0.5 then
        topPattern_FRM = "████       "
    end
    
    local bottomPattern_FRM
    -- if F and T are both off
    if mainPanelDevice:get_argument_value(493) < 0.5 and mainPanelDevice:get_argument_value(494) < 0.5 then
        bottomPattern_FRM = "█████"
    --if F is on and T is off
    elseif mainPanelDevice:get_argument_value(493) > 0.5 and mainPanelDevice:get_argument_value(494) < 0.5 then
        bottomPattern_FRM = "       ████"
    --if F is off and T is off
    elseif mainPanelDevice:get_argument_value(493) > 0.5 and mainPanelDevice:get_argument_value(494) > 0.5 then
        bottomPattern_FRM = ""
    --if F is off and T is on
    elseif mainPanelDevice:get_argument_value(493) < 0.5 and mainPanelDevice:get_argument_value(494) > 0.5 then
        bottomPattern_FRM = "████       "
    end
    
    ExportScript.Tools.SendData(4001, topPattern_FRM .. "\n\n" .. bottomPattern_FRM)
    
    --1 logic
    local topPattern_1
    -- if S and A are both off
    if mainPanelDevice:get_argument_value(461) < 0.5 and mainPanelDevice:get_argument_value(462) < 0.5 then
        topPattern_1 = "█████"
    --if S is on and A is off
    elseif mainPanelDevice:get_argument_value(461) > 0.5 and mainPanelDevice:get_argument_value(462) < 0.5 then
        topPattern_1 = "       ████"
    --if S is off and A is off
    elseif mainPanelDevice:get_argument_value(461) > 0.5 and mainPanelDevice:get_argument_value(462) > 0.5 then
        topPattern_1 = ""
    --if S is off and A is on
    elseif mainPanelDevice:get_argument_value(461) < 0.5 and mainPanelDevice:get_argument_value(462) > 0.5 then
        topPattern_1 = "████       "
    end
    
    local bottomPattern_1
    -- if F and T are both off
    if mainPanelDevice:get_argument_value(463) < 0.5 and mainPanelDevice:get_argument_value(464) < 0.5 then
        bottomPattern_1 = "█████"
    --if F is on and T is off
    elseif mainPanelDevice:get_argument_value(463) > 0.5 and mainPanelDevice:get_argument_value(464) < 0.5 then
        bottomPattern_1 = "       ████"
    --if F is off and T is off
    elseif mainPanelDevice:get_argument_value(463) > 0.5 and mainPanelDevice:get_argument_value(464) > 0.5 then
        bottomPattern_1 = ""
    --if F is off and T is on
    elseif mainPanelDevice:get_argument_value(463) < 0.5 and mainPanelDevice:get_argument_value(464) > 0.5 then
        bottomPattern_1 = "████       "
    end
    
    ExportScript.Tools.SendData(4002, topPattern_1 .. "\n\n" .. bottomPattern_1)
    
    --2 logic
    local topPattern_2
    -- if S and A are both off
    if mainPanelDevice:get_argument_value(466) < 0.5 and mainPanelDevice:get_argument_value(467) < 0.5 then
        topPattern_1 = "█████"
    --if S is on and A is off
    elseif mainPanelDevice:get_argument_value(466) > 0.5 and mainPanelDevice:get_argument_value(467) < 0.5 then
        topPattern_1 = "       ████"
    --if S is off and A is off
    elseif mainPanelDevice:get_argument_value(466) > 0.5 and mainPanelDevice:get_argument_value(467) > 0.5 then
        topPattern_1 = ""
    --if S is off and A is on
    elseif mainPanelDevice:get_argument_value(466) < 0.5 and mainPanelDevice:get_argument_value(467) > 0.5 then
        topPattern_1 = "████       "
    end
    
    local bottomPattern_2
    -- if F and T are both off
    if mainPanelDevice:get_argument_value(468) < 0.5 and mainPanelDevice:get_argument_value(469) < 0.5 then
        bottomPattern_2 = "█████"
    --if F is on and T is off
    elseif mainPanelDevice:get_argument_value(468) > 0.5 and mainPanelDevice:get_argument_value(469) < 0.5 then
        bottomPattern_2 = "       ████"
    --if F is off and T is off
    elseif mainPanelDevice:get_argument_value(468) > 0.5 and mainPanelDevice:get_argument_value(469) > 0.5 then
        bottomPattern_2 = ""
    --if F is off and T is on
    elseif mainPanelDevice:get_argument_value(468) < 0.5 and mainPanelDevice:get_argument_value(469) > 0.5 then
        bottomPattern_2 = "████       "
    end
    
    ExportScript.Tools.SendData(4003, topPattern_2 .. "\n\n" .. bottomPattern_2)
    
    --3 logic
    local topPattern_3
    -- if S and A are both off
    if mainPanelDevice:get_argument_value(471) < 0.5 and mainPanelDevice:get_argument_value(472) < 0.5 then
        topPattern_3 = "█████"
    --if S is on and A is off
    elseif mainPanelDevice:get_argument_value(471) > 0.5 and mainPanelDevice:get_argument_value(472) < 0.5 then
        topPattern_3 = "       ████"
    --if S is off and A is off
    elseif mainPanelDevice:get_argument_value(471) > 0.5 and mainPanelDevice:get_argument_value(472) > 0.5 then
        topPattern_3 = ""
    --if S is off and A is on
    elseif mainPanelDevice:get_argument_value(471) < 0.5 and mainPanelDevice:get_argument_value(472) > 0.5 then
        topPattern_3 = "████       "
    end
    
    local bottomPattern_3
    -- if F and T are both off
    if mainPanelDevice:get_argument_value(473) < 0.5 and mainPanelDevice:get_argument_value(474) < 0.5 then
        bottomPattern_3 = "█████"
    --if F is on and T is off
    elseif mainPanelDevice:get_argument_value(473) > 0.5 and mainPanelDevice:get_argument_value(474) < 0.5 then
        bottomPattern_3 = "       ████"
    --if F is off and T is off
    elseif mainPanelDevice:get_argument_value(473) > 0.5 and mainPanelDevice:get_argument_value(474) > 0.5 then
        bottomPattern_3 = ""
    --if F is off and T is on
    elseif mainPanelDevice:get_argument_value(473) < 0.5 and mainPanelDevice:get_argument_value(474) > 0.5 then
        bottomPattern_3 = "████       "
    end
    
    ExportScript.Tools.SendData(4004, topPattern_3 .. "\n\n" .. bottomPattern_3)
    
    --4 logic
    local topPattern_4
    -- if S and A are both off
    if mainPanelDevice:get_argument_value(476) < 0.5 and mainPanelDevice:get_argument_value(477) < 0.5 then
        topPattern_1 = "█████"
    --if S is on and A is off
    elseif mainPanelDevice:get_argument_value(476) > 0.5 and mainPanelDevice:get_argument_value(477) < 0.5 then
        topPattern_1 = "       ████"
    --if S is off and A is off
    elseif mainPanelDevice:get_argument_value(476) > 0.5 and mainPanelDevice:get_argument_value(477) > 0.5 then
        topPattern_1 = ""
    --if S is off and A is on
    elseif mainPanelDevice:get_argument_value(476) < 0.5 and mainPanelDevice:get_argument_value(477) > 0.5 then
        topPattern_1 = "████       "
    end
    
    local bottomPattern_4
    -- if F and T are both off
    if mainPanelDevice:get_argument_value(478) < 0.5 and mainPanelDevice:get_argument_value(479) < 0.5 then
        bottomPattern_4 = "█████"
    --if F is on and T is off
    elseif mainPanelDevice:get_argument_value(478) > 0.5 and mainPanelDevice:get_argument_value(479) < 0.5 then
        bottomPattern_4 = "       ████"
    --if F is off and T is off
    elseif mainPanelDevice:get_argument_value(478) > 0.5 and mainPanelDevice:get_argument_value(479) > 0.5 then
        bottomPattern_4 = ""
    --if F is off and T is on
    elseif mainPanelDevice:get_argument_value(478) < 0.5 and mainPanelDevice:get_argument_value(479) > 0.5 then
        bottomPattern_4 = "████       "
    end
    
    ExportScript.Tools.SendData(4005, topPattern_4 .. "\n\n" .. bottomPattern_4)
    
    --5 logic
    local topPattern_5
    -- if S and A are both off
    if mainPanelDevice:get_argument_value(481) < 0.5 and mainPanelDevice:get_argument_value(482) < 0.5 then
        topPattern_5 = "█████"
    --if S is on and A is off
    elseif mainPanelDevice:get_argument_value(481) > 0.5 and mainPanelDevice:get_argument_value(482) < 0.5 then
        topPattern_5 = "       ████"
    --if S is off and A is off
    elseif mainPanelDevice:get_argument_value(481) > 0.5 and mainPanelDevice:get_argument_value(482) > 0.5 then
        topPattern_5 = ""
    --if S is off and A is on
    elseif mainPanelDevice:get_argument_value(481) < 0.5 and mainPanelDevice:get_argument_value(482) > 0.5 then
        topPattern_5 = "████       "
    end
    
    local bottomPattern_5
    -- if F and T are both off
    if mainPanelDevice:get_argument_value(483) < 0.5 and mainPanelDevice:get_argument_value(484) < 0.5 then
        bottomPattern_5 = "█████"
    --if F is on and T is off
    elseif mainPanelDevice:get_argument_value(483) > 0.5 and mainPanelDevice:get_argument_value(484) < 0.5 then
        bottomPattern_5 = "       ████"
    --if F is off and T is off
    elseif mainPanelDevice:get_argument_value(483) > 0.5 and mainPanelDevice:get_argument_value(484) > 0.5 then
        bottomPattern_5 = ""
    --if F is off and T is on
    elseif mainPanelDevice:get_argument_value(483) < 0.5 and mainPanelDevice:get_argument_value(484) > 0.5 then
        bottomPattern_5 = "████       "
    end
    
    ExportScript.Tools.SendData(4006, topPattern_5 .. "\n\n" .. bottomPattern_5)
    
    --6 logic
    local topPattern_6
    -- if S and A are both off
    if mainPanelDevice:get_argument_value(486) < 0.5 and mainPanelDevice:get_argument_value(487) < 0.5 then
        topPattern_6 = "█████"
    --if S is on and A is off
    elseif mainPanelDevice:get_argument_value(486) > 0.5 and mainPanelDevice:get_argument_value(487) < 0.5 then
        topPattern_6 = "       ████"
    --if S is off and A is off
    elseif mainPanelDevice:get_argument_value(486) > 0.5 and mainPanelDevice:get_argument_value(487) > 0.5 then
        topPattern_6 = ""
    --if S is off and A is on
    elseif mainPanelDevice:get_argument_value(486) < 0.5 and mainPanelDevice:get_argument_value(487) > 0.5 then
        topPattern_6 = "████       "
    end
    
    local bottomPattern_6
    -- if F and T are both off
    if mainPanelDevice:get_argument_value(488) < 0.5 and mainPanelDevice:get_argument_value(489) < 0.5 then
        bottomPattern_6 = "█████"
    --if F is on and T is off
    elseif mainPanelDevice:get_argument_value(488) > 0.5 and mainPanelDevice:get_argument_value(489) < 0.5 then
        bottomPattern_6 = "       ████"
    --if F is off and T is off
    elseif mainPanelDevice:get_argument_value(488) > 0.5 and mainPanelDevice:get_argument_value(489) > 0.5 then
        bottomPattern_6 = ""
    --if F is off and T is on
    elseif mainPanelDevice:get_argument_value(488) < 0.5 and mainPanelDevice:get_argument_value(489) > 0.5 then
        bottomPattern_6 = "████       "
    end
    
    ExportScript.Tools.SendData(4007, topPattern_6 .. "\n\n" .. bottomPattern_6)
    
    --SPL logic
    local topPattern_SPL
    -- if S and A are both off
    if mainPanelDevice:get_argument_value(496) < 0.5 and mainPanelDevice:get_argument_value(497) < 0.5 then
        topPattern_SPL = "█████"
    --if S is on and A is off
    elseif mainPanelDevice:get_argument_value(496) > 0.5 and mainPanelDevice:get_argument_value(497) < 0.5 then
        topPattern_SPL = "       ████"
    --if S is off and A is off
    elseif mainPanelDevice:get_argument_value(496) > 0.5 and mainPanelDevice:get_argument_value(497) > 0.5 then
        topPattern_SPL = ""
    --if S is off and A is on
    elseif mainPanelDevice:get_argument_value(496) < 0.5 and mainPanelDevice:get_argument_value(497) > 0.5 then
        topPattern_SPL = "████       "
    end
    
    local bottomPattern_SPL
    -- if F and T are both off
    if mainPanelDevice:get_argument_value(498) < 0.5 and mainPanelDevice:get_argument_value(499) < 0.5 then
        bottomPattern_SPL = "█████"
    --if F is on and T is off
    elseif mainPanelDevice:get_argument_value(498) > 0.5 and mainPanelDevice:get_argument_value(499) < 0.5 then
        bottomPattern_SPL = "       ████"
    --if F is off and T is off
    elseif mainPanelDevice:get_argument_value(498) > 0.5 and mainPanelDevice:get_argument_value(499) > 0.5 then
        bottomPattern_SPL = ""
    --if F is off and T is on
    elseif mainPanelDevice:get_argument_value(498) < 0.5 and mainPanelDevice:get_argument_value(499) > 0.5 then
        bottomPattern_SPL = "████       "
    end
    
    ExportScript.Tools.SendData(4008, topPattern_SPL .. "\n\n" .. bottomPattern_SPL)
end


Edited by bones1014
changed to include code
Link to comment
Share on other sites

3 hours ago, bones1014 said:

That's amazing! Are you putting this at the end under the Custom Functions heading? I'd like to play with it a bit.

I copy/pasted for the other buttons. Hope that helps. 🙂
 

function ExportScript.EcmPanel(mainPanelDevice)
    --this is logic for the ECM panel and the associated lights
    --this is designed to be paired with the proper pre-formated image
    --https://en.wikipedia.org/wiki/Block_Elements
    -- 5 of these █ will cover the whole row at Times New Roman 15pt
    -- options for blanking out
        -- left showing |       ████|
        -- right showing|████       |
        -- both showing ||
        -- both hidden|█████|
    
    
    --FRM logic
    local topPattern_FRM
    -- if S and A are both off
    if mainPanelDevice:get_argument_value(491) < 0.5 and mainPanelDevice:get_argument_value(492) < 0.5 then
        topPattern_FRM = "█████"
    --if S is on and A is off
    elseif mainPanelDevice:get_argument_value(491) > 0.5 and mainPanelDevice:get_argument_value(492) < 0.5 then
        topPattern_FRM = "       ████"
    --if S is off and A is off
    elseif mainPanelDevice:get_argument_value(491) > 0.5 and mainPanelDevice:get_argument_value(492) > 0.5 then
        topPattern_FRM = ""
    --if S is off and A is on
    elseif mainPanelDevice:get_argument_value(491) < 0.5 and mainPanelDevice:get_argument_value(492) > 0.5 then
        topPattern_FRM = "████       "
    end
    
    local bottomPattern_FRM
    -- if F and T are both off
    if mainPanelDevice:get_argument_value(493) < 0.5 and mainPanelDevice:get_argument_value(494) < 0.5 then
        bottomPattern_FRM = "█████"
    --if F is on and T is off
    elseif mainPanelDevice:get_argument_value(493) > 0.5 and mainPanelDevice:get_argument_value(494) < 0.5 then
        bottomPattern_FRM = "       ████"
    --if F is off and T is off
    elseif mainPanelDevice:get_argument_value(493) > 0.5 and mainPanelDevice:get_argument_value(494) > 0.5 then
        bottomPattern_FRM = ""
    --if F is off and T is on
    elseif mainPanelDevice:get_argument_value(493) < 0.5 and mainPanelDevice:get_argument_value(494) > 0.5 then
        bottomPattern_FRM = "████       "
    end
    
    ExportScript.Tools.SendData(4001, topPattern_FRM .. "\n\n" .. bottomPattern_FRM)
    
    --1 logic
    local topPattern_1
    -- if S and A are both off
    if mainPanelDevice:get_argument_value(461) < 0.5 and mainPanelDevice:get_argument_value(462) < 0.5 then
        topPattern_1 = "█████"
    --if S is on and A is off
    elseif mainPanelDevice:get_argument_value(461) > 0.5 and mainPanelDevice:get_argument_value(462) < 0.5 then
        topPattern_1 = "       ████"
    --if S is off and A is off
    elseif mainPanelDevice:get_argument_value(461) > 0.5 and mainPanelDevice:get_argument_value(462) > 0.5 then
        topPattern_1 = ""
    --if S is off and A is on
    elseif mainPanelDevice:get_argument_value(461) < 0.5 and mainPanelDevice:get_argument_value(462) > 0.5 then
        topPattern_1 = "████       "
    end
    
    local bottomPattern_1
    -- if F and T are both off
    if mainPanelDevice:get_argument_value(463) < 0.5 and mainPanelDevice:get_argument_value(464) < 0.5 then
        bottomPattern_1 = "█████"
    --if F is on and T is off
    elseif mainPanelDevice:get_argument_value(463) > 0.5 and mainPanelDevice:get_argument_value(464) < 0.5 then
        bottomPattern_1 = "       ████"
    --if F is off and T is off
    elseif mainPanelDevice:get_argument_value(463) > 0.5 and mainPanelDevice:get_argument_value(464) > 0.5 then
        bottomPattern_1 = ""
    --if F is off and T is on
    elseif mainPanelDevice:get_argument_value(463) < 0.5 and mainPanelDevice:get_argument_value(464) > 0.5 then
        bottomPattern_1 = "████       "
    end
    
    ExportScript.Tools.SendData(4002, topPattern_1 .. "\n\n" .. bottomPattern_1)
    
    --2 logic
    local topPattern_2
    -- if S and A are both off
    if mainPanelDevice:get_argument_value(466) < 0.5 and mainPanelDevice:get_argument_value(467) < 0.5 then
        topPattern_1 = "█████"
    --if S is on and A is off
    elseif mainPanelDevice:get_argument_value(466) > 0.5 and mainPanelDevice:get_argument_value(467) < 0.5 then
        topPattern_1 = "       ████"
    --if S is off and A is off
    elseif mainPanelDevice:get_argument_value(466) > 0.5 and mainPanelDevice:get_argument_value(467) > 0.5 then
        topPattern_1 = ""
    --if S is off and A is on
    elseif mainPanelDevice:get_argument_value(466) < 0.5 and mainPanelDevice:get_argument_value(467) > 0.5 then
        topPattern_1 = "████       "
    end
    
    local bottomPattern_2
    -- if F and T are both off
    if mainPanelDevice:get_argument_value(468) < 0.5 and mainPanelDevice:get_argument_value(469) < 0.5 then
        bottomPattern_2 = "█████"
    --if F is on and T is off
    elseif mainPanelDevice:get_argument_value(468) > 0.5 and mainPanelDevice:get_argument_value(469) < 0.5 then
        bottomPattern_2 = "       ████"
    --if F is off and T is off
    elseif mainPanelDevice:get_argument_value(468) > 0.5 and mainPanelDevice:get_argument_value(469) > 0.5 then
        bottomPattern_2 = ""
    --if F is off and T is on
    elseif mainPanelDevice:get_argument_value(468) < 0.5 and mainPanelDevice:get_argument_value(469) > 0.5 then
        bottomPattern_2 = "████       "
    end
    
    ExportScript.Tools.SendData(4003, topPattern_2 .. "\n\n" .. bottomPattern_2)
    
    --3 logic
    local topPattern_3
    -- if S and A are both off
    if mainPanelDevice:get_argument_value(471) < 0.5 and mainPanelDevice:get_argument_value(472) < 0.5 then
        topPattern_3 = "█████"
    --if S is on and A is off
    elseif mainPanelDevice:get_argument_value(471) > 0.5 and mainPanelDevice:get_argument_value(472) < 0.5 then
        topPattern_3 = "       ████"
    --if S is off and A is off
    elseif mainPanelDevice:get_argument_value(471) > 0.5 and mainPanelDevice:get_argument_value(472) > 0.5 then
        topPattern_3 = ""
    --if S is off and A is on
    elseif mainPanelDevice:get_argument_value(471) < 0.5 and mainPanelDevice:get_argument_value(472) > 0.5 then
        topPattern_3 = "████       "
    end
    
    local bottomPattern_3
    -- if F and T are both off
    if mainPanelDevice:get_argument_value(473) < 0.5 and mainPanelDevice:get_argument_value(474) < 0.5 then
        bottomPattern_3 = "█████"
    --if F is on and T is off
    elseif mainPanelDevice:get_argument_value(473) > 0.5 and mainPanelDevice:get_argument_value(474) < 0.5 then
        bottomPattern_3 = "       ████"
    --if F is off and T is off
    elseif mainPanelDevice:get_argument_value(473) > 0.5 and mainPanelDevice:get_argument_value(474) > 0.5 then
        bottomPattern_3 = ""
    --if F is off and T is on
    elseif mainPanelDevice:get_argument_value(473) < 0.5 and mainPanelDevice:get_argument_value(474) > 0.5 then
        bottomPattern_3 = "████       "
    end
    
    ExportScript.Tools.SendData(4004, topPattern_3 .. "\n\n" .. bottomPattern_3)
    
    --4 logic
    local topPattern_4
    -- if S and A are both off
    if mainPanelDevice:get_argument_value(476) < 0.5 and mainPanelDevice:get_argument_value(477) < 0.5 then
        topPattern_1 = "█████"
    --if S is on and A is off
    elseif mainPanelDevice:get_argument_value(476) > 0.5 and mainPanelDevice:get_argument_value(477) < 0.5 then
        topPattern_1 = "       ████"
    --if S is off and A is off
    elseif mainPanelDevice:get_argument_value(476) > 0.5 and mainPanelDevice:get_argument_value(477) > 0.5 then
        topPattern_1 = ""
    --if S is off and A is on
    elseif mainPanelDevice:get_argument_value(476) < 0.5 and mainPanelDevice:get_argument_value(477) > 0.5 then
        topPattern_1 = "████       "
    end
    
    local bottomPattern_4
    -- if F and T are both off
    if mainPanelDevice:get_argument_value(478) < 0.5 and mainPanelDevice:get_argument_value(479) < 0.5 then
        bottomPattern_4 = "█████"
    --if F is on and T is off
    elseif mainPanelDevice:get_argument_value(478) > 0.5 and mainPanelDevice:get_argument_value(479) < 0.5 then
        bottomPattern_4 = "       ████"
    --if F is off and T is off
    elseif mainPanelDevice:get_argument_value(478) > 0.5 and mainPanelDevice:get_argument_value(479) > 0.5 then
        bottomPattern_4 = ""
    --if F is off and T is on
    elseif mainPanelDevice:get_argument_value(478) < 0.5 and mainPanelDevice:get_argument_value(479) > 0.5 then
        bottomPattern_4 = "████       "
    end
    
    ExportScript.Tools.SendData(4005, topPattern_4 .. "\n\n" .. bottomPattern_4)
    
    --5 logic
    local topPattern_5
    -- if S and A are both off
    if mainPanelDevice:get_argument_value(481) < 0.5 and mainPanelDevice:get_argument_value(482) < 0.5 then
        topPattern_5 = "█████"
    --if S is on and A is off
    elseif mainPanelDevice:get_argument_value(481) > 0.5 and mainPanelDevice:get_argument_value(482) < 0.5 then
        topPattern_5 = "       ████"
    --if S is off and A is off
    elseif mainPanelDevice:get_argument_value(481) > 0.5 and mainPanelDevice:get_argument_value(482) > 0.5 then
        topPattern_5 = ""
    --if S is off and A is on
    elseif mainPanelDevice:get_argument_value(481) < 0.5 and mainPanelDevice:get_argument_value(482) > 0.5 then
        topPattern_5 = "████       "
    end
    
    local bottomPattern_5
    -- if F and T are both off
    if mainPanelDevice:get_argument_value(483) < 0.5 and mainPanelDevice:get_argument_value(484) < 0.5 then
        bottomPattern_5 = "█████"
    --if F is on and T is off
    elseif mainPanelDevice:get_argument_value(483) > 0.5 and mainPanelDevice:get_argument_value(484) < 0.5 then
        bottomPattern_5 = "       ████"
    --if F is off and T is off
    elseif mainPanelDevice:get_argument_value(483) > 0.5 and mainPanelDevice:get_argument_value(484) > 0.5 then
        bottomPattern_5 = ""
    --if F is off and T is on
    elseif mainPanelDevice:get_argument_value(483) < 0.5 and mainPanelDevice:get_argument_value(484) > 0.5 then
        bottomPattern_5 = "████       "
    end
    
    ExportScript.Tools.SendData(4006, topPattern_5 .. "\n\n" .. bottomPattern_5)
    
    --6 logic
    local topPattern_6
    -- if S and A are both off
    if mainPanelDevice:get_argument_value(486) < 0.5 and mainPanelDevice:get_argument_value(487) < 0.5 then
        topPattern_6 = "█████"
    --if S is on and A is off
    elseif mainPanelDevice:get_argument_value(486) > 0.5 and mainPanelDevice:get_argument_value(487) < 0.5 then
        topPattern_6 = "       ████"
    --if S is off and A is off
    elseif mainPanelDevice:get_argument_value(486) > 0.5 and mainPanelDevice:get_argument_value(487) > 0.5 then
        topPattern_6 = ""
    --if S is off and A is on
    elseif mainPanelDevice:get_argument_value(486) < 0.5 and mainPanelDevice:get_argument_value(487) > 0.5 then
        topPattern_6 = "████       "
    end
    
    local bottomPattern_6
    -- if F and T are both off
    if mainPanelDevice:get_argument_value(488) < 0.5 and mainPanelDevice:get_argument_value(489) < 0.5 then
        bottomPattern_6 = "█████"
    --if F is on and T is off
    elseif mainPanelDevice:get_argument_value(488) > 0.5 and mainPanelDevice:get_argument_value(489) < 0.5 then
        bottomPattern_6 = "       ████"
    --if F is off and T is off
    elseif mainPanelDevice:get_argument_value(488) > 0.5 and mainPanelDevice:get_argument_value(489) > 0.5 then
        bottomPattern_6 = ""
    --if F is off and T is on
    elseif mainPanelDevice:get_argument_value(488) < 0.5 and mainPanelDevice:get_argument_value(489) > 0.5 then
        bottomPattern_6 = "████       "
    end
    
    ExportScript.Tools.SendData(4007, topPattern_6 .. "\n\n" .. bottomPattern_6)
    
    --SPL logic
    local topPattern_SPL
    -- if S and A are both off
    if mainPanelDevice:get_argument_value(496) < 0.5 and mainPanelDevice:get_argument_value(497) < 0.5 then
        topPattern_SPL = "█████"
    --if S is on and A is off
    elseif mainPanelDevice:get_argument_value(496) > 0.5 and mainPanelDevice:get_argument_value(497) < 0.5 then
        topPattern_SPL = "       ████"
    --if S is off and A is off
    elseif mainPanelDevice:get_argument_value(496) > 0.5 and mainPanelDevice:get_argument_value(497) > 0.5 then
        topPattern_SPL = ""
    --if S is off and A is on
    elseif mainPanelDevice:get_argument_value(496) < 0.5 and mainPanelDevice:get_argument_value(497) > 0.5 then
        topPattern_SPL = "████       "
    end
    
    local bottomPattern_SPL
    -- if F and T are both off
    if mainPanelDevice:get_argument_value(498) < 0.5 and mainPanelDevice:get_argument_value(499) < 0.5 then
        bottomPattern_SPL = "█████"
    --if F is on and T is off
    elseif mainPanelDevice:get_argument_value(498) > 0.5 and mainPanelDevice:get_argument_value(499) < 0.5 then
        bottomPattern_SPL = "       ████"
    --if F is off and T is off
    elseif mainPanelDevice:get_argument_value(498) > 0.5 and mainPanelDevice:get_argument_value(499) > 0.5 then
        bottomPattern_SPL = ""
    --if F is off and T is on
    elseif mainPanelDevice:get_argument_value(498) < 0.5 and mainPanelDevice:get_argument_value(499) > 0.5 then
        bottomPattern_SPL = "████       "
    end
    
    ExportScript.Tools.SendData(4008, topPattern_SPL .. "\n\n" .. bottomPattern_SPL)
end

 

I am putting the function near the bottom, yes. 
Remember to call the function using `ExportScript.EcmPanel(mainPanelDevice)` within either `ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)` or `ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)`.
Thanks for the copy/paste!

  • Thanks 1
Link to comment
Share on other sites

10 minutes ago, Bailey said:

I am putting the function near the bottom, yes. 
Remember to call the function using `ExportScript.EcmPanel(mainPanelDevice)` within either `ExportScript.ProcessIkarusDCSConfigHighImportance(mainPanelDevice)` or `ExportScript.ProcessIkarusDCSConfigLowImportance(mainPanelDevice)`.
Thanks for the copy/paste!

I must be doing something wrong with the nesting because I can't get the button to change when I hit the BIT. I'm trying the FRM button and referencing 4001. I'll keep playing.

Link to comment
Share on other sites

5 hours ago, scoobie said:

Beautiful! :clap: Yeah, that's the "cover icon with characters" or "multiple annunciators in one button" thing. However... aren't you, by any chance, getting artifacts such that I get as shown in the attached picture - those greyish outlines? They are actually 100% black "full rectangle" and "empty rectangle" (top row) characters on 100% black bitmap (icon).

I only get such "ghost" outlines on the real (hardware) Stream Deck, they're invisible in Stream Deck software (in Windows). I have no idea where they come from.
(This is Dora gear/flaps - in the picture all are up, hence all 3 red lamps are uncovered.)

artifacts.png

 

Yes, I do get the ghost outlines. I tried to lessen the effect by making the color more blue/grey-ish and by making enough boxes to go across the entire width.
unknown.png
unknown.png

Hopefully its a workable solution. It does not look as bad IRL at distance.


Edited by Bailey
Link to comment
Share on other sites

1 hour ago, bones1014 said:

I must be doing something wrong with the nesting because I can't get the button to change when I hit the BIT. I'm trying the FRM button and referencing 4001. I'll keep playing.

I have attached the working profile and lua. Specifically for the F16 ECM panel, pay attention to line 694 and lines 1047-1321 in the lua. I'll update the Wiki later.
The BIT button is there for testing. Tap the ECM button once to turn it on. Double tap it to turn the button off...
 

unknown.png

Oh, and before I forget, I can't get the ECM buttons to work nicely via a DCS Interface Switch Input button. 
Here is my setup for ECM 1. A press will enable it and a double press is required to disable it, which seems odd. Any ideas why and/or a solution?
unknown.png

The ExportScripts Library has been updated with the files mentioned above: 
https://github.com/asherao/DCS-ExportScripts
https://github.com/asherao/DCS-ExportScripts/wiki/F-16C

 


Edited by Bailey
Link to comment
Share on other sites

1 hour ago, Bailey said:

I have attached the working profile and lua. Specifically for the F16 ECM panel, pay attention to line 694 and lines 1047-1321 in the lua. I'll update the Wiki later.
The BIT button is there for testing. Tap the ECM button once to turn it on. Double tap it to turn the button off...
 

unknown.png

Oh, and before I forget, I can't get the ECM buttons to work nicely via a DCS Interface Switch Input button. 
Here is my setup for ECM 1. A press will enable it and a double press is required to disable it, which seems odd. Any ideas why and/or a solution?
unknown.png

F-16C_50.lua 85.24 kB · 1 download F16 ECM Panel.streamDeckProfile 168.87 kB · 1 download

Works great! As far as making it work correctly with the button press have you tried using an Incremental Input? Send me the image files and I'll make some buttons.
image.png


Edited by bones1014
Link to comment
Share on other sites

31 minutes ago, bones1014 said:

Works great! As far as making it work correctly with the button press have you tried using an Incremental Input?
image.png

The only issue I have with that solution is that a button may have to be pressed one extra time to "sync" depending on the start state of the aircraft and if the Increment value is 1 or -1.

Edit. Nevermind. Both cold and hot starts have the same buttons depressed. The above issue is fixed if you have ECM 1 Increment Value as 1 and all others as -1. Thank you. Wiki has been updated.


Edited by Bailey
Link to comment
Share on other sites

You, folks, are impossible! I went to bed, got up in the morning, hardly had a second to scratch my butt and suddently I see this: "Hey, Lua's ready!" 😄
Amazing! Thanks a lot 🙂
Thank you, Bailey, for info on the ghost outlines - I thought I was doing something wrong, but apparently it is some kind of "contrast enhancement" (for text) that Stream Deck is using. In normal circumstances I guess it's a good feature. My outlines aren't as bad, it was my camera which amplified the contrast and brought out those outlines (damned digital signal processing! 😉). And I got one thing wrong - the outlines are also visible in Stream Deck software (contrary to what I said), they're just hard to spot on 1080p (plus my eyes are cr*p). Never mind.
Great job, again :thumbup:


Edited by scoobie
  • Like 1

i7-8700K 32GB 2060(6GB) 27"@1080p TM Hawg HOTAS TPR TIR5 SD-XL 2xSD+ HC Bravo button/pot box

Link to comment
Share on other sites

Hey guys,

I know this is a little off topic, but I wanted to get this in a place the powerhouses of StreamDeck (i.e. Bailey, ctytler, and many others) would see it.

I just got my combat and takeoff panels from WinWing for Christmas.  Man are they great!  At first I couldn't get the lights to sync but once I clicked on the "Fix lua" button within the SimmAppPro app life was good.  So I jumped into a mission (I fly exclusively in the hornet) and I realized my Streamdeck XL wasn't working.  I use it for many things in game, mostly the UFC.  After looking around, I remembered I "fixed" the lua in the SimAppPro app, so I went to the Export.lua file and saw that it had completed removed the StreamDeck export script.  OK, I thought, I'll add it back in.  I did, then jumped back into DCS.  Now the lights aren't syncing again but the StreamDeck is working.  I even tried placing the StreamDeck script before then after the WinWing script but no joy!

I researched a bit and tried a suggest I found to click the box to "Close the modification of Export.lua file," but that did not work for me. 

I have started a conversation with WinWing to see if they have a solution.  They replied with, "Our software engineer will check but can not sure figure it out as 3rd part hardware. please waiting for our news."  

Has anyone else run in to the same issue?  If so, did you find a solution/workaround?  I really want both to work and I am SURE I am not the only one to run into this issue.

Lastly, here is the Export.lua after the SimAppPro fixes it.

local wwtlfs=require('lfs')
dofile(wwtlfs.writedir()..'Scripts/wwt/wwtExport.lua')

Here is the script needed for my StreamDeck to function.

dofile(lfs.writedir()..[[Scripts\DCS-ExportScript\ExportScript.lua]])

I posted the same topic under WinWing in the Input/Output forum called "Control panel light sync or Streamdeck...not both"

Thanks and Happy New Year!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...