How can I sort channels by a custom property?

Hello.
I have written a script that creates a series of formatted charts in View.  The data comes from TDMS files with several groups of channels with some custom properties assigned to the channels.  I would like to sort the channels within each group by one of these custom properties so that the curves display in the desired order.
It appears that ChnMove and ChnRenumber can be used to reorder the channels, but how can I programatically sort the channels by a channel property?
Thanks,
Craig

Hello Craig!
Unfortunately DIAdem doesn't have a adequate command. You have to use some lines of script code. Try this bubblesort adaption:
Option Explicit
Call GroupChnSort(1,"name")
Sub GroupChnSort(ByRef nGroupIndex, ByRef sgPropName)
Dim i
Dim j
Dim n
Dim anCNo()
If GroupChnCount(nGroupIndex) > 1 Then
ReDim anCNo( GroupChnCount(nGroupIndex)-1 )
For i=1 To GroupChnCount(nGroupIndex)
anCNo(i-1) = i
Next
For i = 0 to UBound(anCNo)
For j = i+1 to UBound(anCNo)
If ChnPropValGet("[" & nGroupIndex & "]/[" & anCNo(i) & "]", sgPropName) > _
ChnPropValGet("[" & nGroupIndex & "]/[" & anCNo(j) & "]", sgPropName) Then
n = anCNo(i)
anCNo(i) = anCNo(j)
anCNo(j) = n
End If
Next
Next
For i=1 To GroupChnCount(nGroupIndex)
Call ChnMove( anCNo(i-1), nGroupIndex, i)
Next
End If
End Sub
The string compare is casessensitive. You can wrap the ChnPropValGet with a UCase to change this.
Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  

Similar Messages

  • Hello, How can I edit or delete a custom label in the contacts list on iOS 7.0.3 on iPhone 4S ?

    Hello, How can I edit or delete a custom label in the contacts list on iOS 7.0.3 on iPhone 4S ?
    i need it so muchhh!

    Sort of depend on what you are trying to do precisely. In Edit mode, if you tap on any label, you will be given a list of options, plus an Add Custom Label option near the bottom of the list

  • How can I Sort Enumeration

    Hi Guys,
    Please help me solving this problem.
    I have some objects which I am read using Enumeration. But these objects are processed without order by Enumeration.
    How can I sort them without looping so they are read in order. Please bear in mind that I can sort them prior to the use of Enumeration.
    Thanks

    Sorry typing mistake 'I can' = 'I cannot'
    and these are custom ObectsThen you must read the objects one by one using the enumeration and put them into a new data structure. This can either be a tree or a list. If it's a tree, like a TreeSet, then the objects will be kept in sorted order as they're entered. If it's a list, like for example an ArrayList, then you'll have to sort it afterwards. Finally you have to iterate one more time using an Iterator but then they'll come out in sorted order.
    For the above to work the class (of the objects you store ) must either implement an interface called Comparable. Alternatively you can supply a so called Comparator object either to the TreeSet constructor or with the ArrayList sort call.

  • How can I sort lines of data (alphabetically) in the new pages 5.0?

    How can I sort lines of data (alphabetically) in the new pages 5.0?
    It was very simple to do in the previou version of pages.

    I'm not sure why people are torturing themselves with Pages 5 given the nearly universal outcry on this forum and the incredibly negative reviews elswhere, such as the App Store.
    Pages 4.3 should still be in an iWorks folder within your Applications folder.  Just use that.
    Please remember to tell Apple what we need from them at:
    http://www.apple.com/feedback/pages.html

  • How can i view and apply new custom patterns without going to preset manager? i had this facility but have now lost it

    how can i view and apply new custom patterns without going to preset manager? i had this facility but have now lost it.  i design patterns but am fairly new to photoshop. i used to be able to click on the drop down menu in patterns in the 'fill' box but cannot now do this.  have i inadvertently clicked on something to turn this facility off?  i now have to go to 'preset manager' and manually move my new design to the first box and click 'done' so that i can use it.

    Which version of photoshop are you using?
    After you define a custom pattern it should be added to the bottom of whatever patterns are already loaded.
    For example, if you define a custom pattern and then go to Edit>Fill>Pattern, the newly defined pattern should have been added to the existing loaded patterns.

  • How can I sort files in a folder by name?

    How can I sort files in a folder by name? iFS first sort files that starts with upper-case letter and then files with lower-case letter.
    Like:
    A_file
    B_file
    a_file
    b_file
    I want:
    A-file
    a_file
    B_file
    b_file
    This doesn't help:
    String[] sort_attributes = {"NAME"};
    boolean [] sort_orders = {true};
    SortSpecification sort = new SortSpecification(sort_attributes, sort_orders);
    currentFolder.setSortSpecification(sort);
    Do I have to get all items in a folder and then sort them?
    /Elin

    I do not think there is a way to do that without add-ons
    There are a couple of workarounds I am aware of
    * Add the bookmarks manually in the bookmarks library and choose the position. That is using Show all bookmarks -> open required folder -> select a position and right click -> add new bookmark <br />Rather a slow and clumsy process
    * Sort a folder and copy it. If you sort the folder contents then copy and paste them they remain in that order when pasted.
    There are add-ons but I have not tried them. For example
    * https://addons.mozilla.org/firefox/addon/simplesort-bookmarks/
    * https://addons.mozilla.org/firefox/addon/auto-sort-bookmarks/
    There will be others available and take note of the advice to backup bookmarks manaully.
    * [[Restore bookmarks from backup or move them to another computer#w_manual-backup]]_manual-backup

  • How can I sort albums in a genre by release date in the itunes store

    How can I sort albums in a genre by release date in the itunes store

    Did you figure this out? Am having the same problem.
    EDIT:
    Found the group in store (in this case Juana Molina) It said music -> alternative
    Changed to column view, and could not find the artist at all in any of the sub categories.
    iTunes is really the biggest pain in the .... and has gotten worse over the years.

  • HT1267 The Apple ID in my new IPhone is not the same as my ID . how can i sort this

    Hi, The Users ID on My New IPhone Is not the same as my apple ID
    How can I sort this ...

    Got it!!!!  A re-install is NOT the answer.  You need to turn on individual notifications under Settings > Facebook > Push Notifications, BUT (and this is a big and confusing BUT) you also need to turn on global push settings under Settings > Mail, Contacts, Calendards > Fetch New Data (and change the Push slider to 'on').  This doesn't sound like it makes sense, but I guess that the push slider under 'Mail, Contacts, Calendars' is actually for ALL push notifications on iPhone, and not just Mail, Contacts and Calendar apps!

  • How can I add a new message(custom text message) to the holiday approval em

    How can I add a new message(custom text message) to the holiday approval email-notification sent to the manager?
    TIA

    The answer is 'not very easily', unless the information you want to display is the employee's leave balances. In 12.1.3 Oracle have delivered functionality that allows you to include the leave balances in the approval notifications out-the-box, ie, without customization.
    For any other information you're probably going to have to customize the standard delivered HRSSA workflow. Within this workflow, the Leave of Absence functionality uses the Notify Approver (Embedded) (HR_APPROVER_NTF) notification. The body of this notification is set to the Notify Approver (Embedded) (HR_NTF_EMBEDDED_REGION) attribute. This in turn defaults to:
    JSP:/OA_HTML/OA.jsp?OAFunc=-&HR_EMBEDDED_REGION-&NtfId=-&#NID-
    So essentially you can change the HR_APPROVER_NTF notification. The problem with changing this notification is that it's generic - it's used for all SSHR functions and not just Leave of Absence. That means you have to make other, more substantial, customizations to the workflow to ensure the changes you make only applies to LOA.
    The other option is to personalize the review page (ie, the region referenced in &HR_EMBEDDED_REGION) to include whatever messages you want. But that means they'll appear on the Review page and all LOA approval notifications and that might not be what you want.
    It's usually better to live with what Oracle deliver and find an alternative solution! What's the content of the message you want to include?

  • Photos for iOS: How can i sort all of my albums automatically in alphabetical order

    Hey there,
    first off, why isn't there a a community for the new Photos app?
    Anyway, here is my problem:
    How can i sort my albums on the new Photos app on iOS?
    I think it's not possible at the moment.
    I am using the iCloud Photo library and uploadet all of my 15.000 photos from the last 15 years.
    And because of that, i now have many many albums on Photos now.
    Overall i love the new app and i love the iCloud Photo library, but i cannot sort my albums on the iOS app automatically in alphabetical order.
    I can sort albums manual, but who wants that, when you have so many of them???
    I have Photos on my Mac too and there i am able to do sort them in alphabetical order. But it is not adopted to iOS or the iCloud Web-App.
    Because of that, i have a complete picture chaos on my iPhone and when i am looking for this one pic in that one album it takes me forever to find it.
    So please Apple, fix this and we all can live happily ever after!
    Thank you!

    Moments in Photo are the new Events.  T
    here's a way to simulate events in Photos.
    When the library was first migrated there was a folder created titled iPhoto Events and all migrated iPhoto Events are represented by an album in the folder. To open the sidebar if it's not open use the Option+Command+S key combination.
    When new photos are imported into the Photos library go to the Last Import smart album, select all the photos and use the File ➙ New Album menu option or use the key combination Command+N.  Name it as desired.  It will appear just above the iPhoto Events folder where you can drag it into the iPhoto Events folder
    When you click on the iPhoto Events folder you'll get a simulated iPhoto Events window showing all of the albums.
    The downside to this simulation is that the Album/Events can only be sorted automatically by Title while viewed in the Folder in the main window or in the sidebar. But they can be sorted manually.
    Ask Apple for more sorting options in Photos via https://www.apple.com/feedback/photos.html.

  • How can I sort movies by genre on itunes  from ipad 2 ?

    If i find a movie for buy in itunes ( from pc ) i can select the genre (action , comedy ..) for optimize the search. In mi ipad 2 i cannot do this  , i can select genre for music , apps , etc but in movies i only see alphabetical order and older / news movies .
    How can I sort movies by genre on itunes  from ipad 2 ?¿
    Thans very much ¡

    I'm looking for an answer to this same question.  I can sort (group) by Genre on iTunes and Apple TV - but not by brand new iPad 2...? 

  • How can I sort movies by price in iTunes?

    How can I sort movies by price in iTunes?

    How can you sort ANYTHING in the iTunes store now???

  • How can I sort my photos in a descending order as I could in iPhotos

    How can I sort my photos in a descending or ascending order as I could in iPhotos?

    Greetings Regina,
    Hope Waukesha is treating you well, haven't been there in years
    Events are sorted in the following ways:
    If Date, Keyword, Title, and Rating are not what you are looking for then it is time to start using Albums.
    Highlight the images you wish to work with and then go to File > New > Album (you can drag more images into this Album later if you want to arrange more of them.)
    Once you have the images in an Album you can use the "Manually" sort option which means you can drag the images into whatever order your heart desires.
    Hope that helps.

  • How can I sort the words in a document into an alphabetical list?

    How can I sort the words in a document into an alphabetical list? Thanks!

    writer888 wrote:
    How can I sort the words in a document into an alphabetical list? Thanks!
    Copy the words to the Mac's clipboard (Edit menu> Copy)
    Paste into TextEdit 
    Next open the Edit > Find > Find window in Text Edit.
    Highlight a space between two words and Edit menu > copy, paste into the Find field
    Next create a return in the middle of your text and copy that and paste into the Replace field
    Click Replace All.
    Now Edit > Select All and Edit > Copy
    Open a Spreadsheet program with Sort ability and paste into the second column cell from the top
    place a "a" into the top column cell, select the entire colum
    Sort desending order
    Now if you need it out of spreadsheet format, then your going to need to copy just the data cells (not the entire column to avoid problems) and Paste "Special" as unformatted text into a word processing program
    If you need to get rid of the Returns, do the opposite you did in Text Edit, replace the Returns with Spaces
    A chore, but it's rare one needs to sort words into alaphabetical order.
    FYI, I used TextEdit and the free LibreOffice (Spreadsheet and Word Processing) for the above effects.

  • How can I edit or delete a custom label in the contacts list on iOS 7 on iPhone 4S ?

    How can I edit or delete a custom label in the contacts list on iOS 7 on iPhone 4S ?

    Alfre311 wrote:
    I've been trying to find a way to do this since I updated to IOS 7, and I've just found the solution/explanation, even tho is a bit heavy to carry out.
    IOS 6 creates custom labels and save them giving you the option to delete them.
    IOS 7 creates custom labels but don't save them, so there is no need to have the option to delete them.
    But here comes the problem, if you have some custom labes saved in you Iphone / Ipad with IOS 6 and you update it to IOS 7, the device will keep those labels saved, but you wont be able to delete them.
    I realized this by going to contacts on Icloud. There those labels that I had on my devices weren't there. So simply restoring your device and configuring it as a new one to later sync your Icloud Contacts, will solve the problem.
    I know this post is old, but I might just try this with iOS 8. I have outdated custom labels that annoy me, because I still seem them in the list as options. If I get desperate enough, I may try your solution.

Maybe you are looking for

  • Macbook Pro 15 inch Crashes

    I've been having an issue with my Macbook Pro which started possibly two weeks before April 21st. My computer screen went black while I was in the process of using it. The fans were still going, I pressed a button to see if it were asleep but nothing

  • .Mac Web Gallery - Limit to photos per gallery?

    Is there a limit to how many photos you can have in any one gallery? I've dedicated 5 GB to my .Mac web gallery and have published 10 or so galleries totaling approximately 700 MB. There is one project that I want to make into a gallery that is 307 p

  • Ati Radeon 4870

    Does anyone know if the ATI Radeon 4870 will fit and work inside of a B/W G3? I heard someone did put one in and it works great.

  • Help with Shockwave player reinstall

    I recently updated my system (PC, Windows 7, updated to IE 11), and the shockwave player needed to be updated. Tried to do that, but won't work. My system is 64 bit, but the IE 11 running is 32 bit version.  Tried numerous ways to update, then I remo

  • Import parameter to method does not default when executed

    Hi Everybody...i have a method with import parameter IV_DATE type SY-DATUM default SY-DATUM. When i execute the method the system date does not default...the IV_DATE field is blank(Spaces). Is there anybody that can help. This is very strange. Thanks