FetchUsedChannels returns list of channels in use
()
| 685 | } |
| 686 | |
| 687 | // FetchUsedChannels returns list of channels in use |
| 688 | func (a *API) FetchUsedChannels() ([]Channel, error) { |
| 689 | channels := []Channel{} |
| 690 | f, err := a.FetchSettings() |
| 691 | if err != nil { |
| 692 | return channels, err |
| 693 | } |
| 694 | for ch := range MeasureChannelDatatypeMap { |
| 695 | chInstalled := f.Section("measure").Key(fmt.Sprintf("%s\\installed", ch.CalnexAPI())).String() |
| 696 | if chInstalled != "1" { |
| 697 | continue |
| 698 | } |
| 699 | |
| 700 | chStatus := f.Section("measure").Key(fmt.Sprintf("%s\\used", ch.CalnexAPI())).String() |
| 701 | if chStatus == "Yes" { |
| 702 | channels = append(channels, ch) |
| 703 | } |
| 704 | } |
| 705 | return channels, err |
| 706 | } |
| 707 | |
| 708 | // FetchSettings returns the calnex settings |