-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFilters.cs
80 lines (73 loc) · 2.46 KB
/
Filters.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// --------------------------------------------------------------------------------
// VariScan module
//
// Description:
//
// Environment: Windows 10 executable, 32 and 64 bit
//
// Usage: TBD
//
// Author: (REM) Rick McAlister, [email protected]
//
// Edit Log: Rev 1.0 Initial Version
//
// Date Who Vers Description
// ----------- --- ----- -------------------------------------------------------
//
// ---------------------------------------------------------------------------------
//
using System;
using TheSky64Lib;
namespace VariScan
{
public partial class Filters
{
public class ActiveFilter
{
//public ColorIndexing.StandardColors JcAssign { get; set; }
public string FilterName { get; set; }
public int FilterIndex { get; set; }
}
public static string[] FilterNameSet()
{
//Figure out the filter mapping
//Find the filter name for the filter filter Number
ccdsoftCamera tsxc = new ccdsoftCamera();
try { tsxc.Connect(); }
catch { return null; }
int filterCount = tsxc.lNumberFilters;
string[] TSXFilterList = new string[filterCount];
for (int f = 0; f < filterCount; f++)
TSXFilterList[f] = (tsxc.szFilterName(f));
return TSXFilterList;
}
public static string LookUpFilterName(int filterIndex)
{
ccdsoftCamera tsxc = new ccdsoftCamera();
return (tsxc.szFilterName(filterIndex));
}
public static int? LookUpFilterIndex(string filterName)
{
string[] fnl = FilterNameSet();
if (fnl == null)
return null;
for (int i = 0; i < fnl.Length; i++)
if (fnl[i].Contains(filterName))
return i;
return null;
}
//public static string? LookUpAssignment(ColorIndexing.StandardColors jcAssign)
//{
// Configuration cfg = new Configuration();
// if (File.Exists(cfg.ColorListPath))
// {
// ColorIndexing cL = new ColorIndexing();
// List<Filters.ActiveFilter> afList = cL.GetActiveFilters();
// Filters.ActiveFilter filter = afList.Find(x => x.JcAssign == jcAssign);
// return filter.FilterIndex.ToString();
// }
// else
// return null;
//}
}
}