tonydoss I changed qaqc.setDefaultSetting("ChannelName", data.timeSeriesNames()[0]) to qaqc.setDefaultSetting("Channels", data.timeSeriesNames()[0]), but the module behaves the same as in my previous post.
In the code that gets the channel:
try:
group = data.selectionGroup(settings['GroupName'])
channels = [data.timeSeries(c) for c in settings['Channels']]
max_rsd = settings['MaxRSD']
zscore_cutoff = settings['ZScoreCutoff']
except:
print("There was an issue with getting the settings...")
print(settings)
qaqc.pushHtml('Cannot run with these settings')
return
It's expecting a list (i.e. channels = [data.timeSeries(c) for c in settings['Channels']]
is trying to loop through a list. In the part where you set the channel, it's setting it to a single string:
qaqc.setDefaultSetting("Channels", data.timeSeriesNames()[0])
That is, the [0] is saying "Take the first item in the list, and return that. Instead, you want to return a list. In this case, you just want one value in the list, so I changed it to this:
qaqc.setDefaultSetting("Channels", data.timeSeriesNames()[0:1])
and that works for me. You'll notice I popped in some debug statements if you get there.
Now the reason it doesn't work when you first open the QAQC module is because the defaults haven't been set. This makes sense because you don't know what the user wants to plot. So I just added a quick if statement to the top to stop this showing as an error:
if len(settings) < 1:
qaqc.pushHtml('Please choose some settings to run this module')
return
I put this before where you try to get the default values (around Line 23 in your script). This is just one way around this. The other way would be to set the values instead of printing the message like I have above.
Also, regarding the default values not showing up, I found a typo where you're updating the values in the combo boxes (Line 91 has a typo in it). The channel combobox won't show a single value because it's a fancy channel combo box that can have multiple selections.
I hope this helps. I know it can be confusing (I spent a little while going through this example myself). But it's a really nifty QAQC module, so once it's up and running, hopefully it'll be quite useful. I'm guessing once you have it set up, you could have it preset to the channels you want to check regularly?
-Bence