File tree Expand file tree Collapse file tree 16 files changed +998
-14
lines changed
CameraControl.Application/Tools Expand file tree Collapse file tree 16 files changed +998
-14
lines changed Original file line number Diff line number Diff line change 226
226
<Compile Include =" Classes\PhotoSession.cs" />
227
227
<Compile Include =" Classes\PhotoUtils.cs" />
228
228
<Compile Include =" Classes\PipeServerT.cs" />
229
+ <Compile Include =" Classes\PluginSetting.cs" />
229
230
<Compile Include =" Classes\PrintSettings.cs" />
230
231
<Compile Include =" Classes\Queue\QueueItemFileItem.cs" />
231
232
<Compile Include =" Classes\Settings.cs" />
Original file line number Diff line number Diff line change @@ -392,13 +392,7 @@ public bool AskSavePath
392
392
}
393
393
}
394
394
395
- private string _configFile ;
396
-
397
- public string ConfigFile
398
- {
399
- get { return _configFile ; }
400
- set { _configFile = value ; }
401
- }
395
+ public string ConfigFile { get ; set ; }
402
396
403
397
public TimeLapseSettings TimeLapseSettings { get ; set ; }
404
398
public PrintSettings PrintSettings { get ; set ; }
@@ -696,6 +690,10 @@ public override string ToString()
696
690
return Name ;
697
691
}
698
692
693
+ /// <summary>
694
+ /// Return selected items
695
+ /// </summary>
696
+ /// <returns>Empty list if no item is selected</returns>
699
697
public AsyncObservableCollection < FileItem > GetSelectedFiles ( )
700
698
{
701
699
lock ( _locker )
@@ -710,6 +708,24 @@ public AsyncObservableCollection<FileItem> GetSelectedFiles()
710
708
}
711
709
}
712
710
711
+ /// <summary>
712
+ /// Return items with i series
713
+ /// </summary>
714
+ /// <returns>Empty list if no item was found</returns>
715
+ public AsyncObservableCollection < FileItem > GetSeries ( int i )
716
+ {
717
+ lock ( _locker )
718
+ {
719
+ AsyncObservableCollection < FileItem > list = new AsyncObservableCollection < FileItem > ( ) ;
720
+ foreach ( FileItem fileItem in Files )
721
+ {
722
+ if ( fileItem . Series == i )
723
+ list . Add ( fileItem ) ;
724
+ }
725
+ return list ;
726
+ }
727
+ }
728
+
713
729
public void SelectAll ( )
714
730
{
715
731
lock ( _locker )
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Linq ;
4
+ using System . Text ;
5
+ using System . Threading . Tasks ;
6
+ using System . Xml . Serialization ;
7
+
8
+ namespace CameraControl . Core . Classes
9
+ {
10
+ public class PluginSetting
11
+ {
12
+ public string Name { get ; set ; }
13
+ public List < ValuePair > Values { get ; set ; }
14
+
15
+ public PluginSetting ( )
16
+ {
17
+ Values = new List < ValuePair > ( ) ;
18
+ }
19
+
20
+ /// <summary>
21
+ /// Return value for name parameter
22
+ /// </summary>
23
+ /// <param name="name"></param>
24
+ /// <returns> string</returns>
25
+ [ XmlIgnore ]
26
+ public object this [ string name ]
27
+ {
28
+ get
29
+ {
30
+ foreach ( var value in Values )
31
+ {
32
+ if ( value . Name == name )
33
+ return value . Value ;
34
+ }
35
+ return "" ;
36
+ }
37
+ set
38
+ {
39
+ foreach ( var values in Values )
40
+ {
41
+ if ( values . Name == name )
42
+ {
43
+ values . Value = value . ToString ( ) ;
44
+ return ;
45
+ }
46
+ }
47
+ Values . Add ( new ValuePair ( ) { Name = name , Value = value . ToString ( ) } ) ;
48
+ }
49
+ }
50
+
51
+
52
+ public bool GetBool ( string name )
53
+ {
54
+ return ( from value in Values where value . Name == name select value . Value == "True" ) . FirstOrDefault ( ) ;
55
+ }
56
+
57
+ public int GetInt ( string name )
58
+ {
59
+ int i = 0 ;
60
+ foreach ( var value in Values )
61
+ {
62
+ if ( value . Name == name )
63
+ {
64
+ if ( int . TryParse ( value . Value , out i ) )
65
+ return i ;
66
+ }
67
+ }
68
+ return 0 ;
69
+ }
70
+ }
71
+ }
Original file line number Diff line number Diff line change @@ -886,6 +886,7 @@ public bool LoadCanonTransferMode
886
886
887
887
public bool FullScreenInSecondaryMonitor { get ; set ; }
888
888
public bool Autorotate { get ; set ; }
889
+ public ObservableCollection < PluginSetting > PluginSettings { get ; set ; }
889
890
890
891
public bool ShowThumbInfo
891
892
{
@@ -943,6 +944,26 @@ public static string ApplicationFolder
943
944
get { return Path . GetDirectoryName ( System . Reflection . Assembly . GetExecutingAssembly ( ) . Location ) ; }
944
945
}
945
946
947
+ /// <summary>
948
+ /// Return plugin settings with specified name
949
+ /// </summary>
950
+ /// <param name="name"></param>
951
+ /// <returns></returns>
952
+ public PluginSetting this [ string name ]
953
+ {
954
+ get
955
+ {
956
+ foreach ( var pluginSetting in PluginSettings )
957
+ {
958
+ if ( pluginSetting . Name == name )
959
+ return pluginSetting ;
960
+ }
961
+ var pl = new PluginSetting ( ) { Name = name } ;
962
+ PluginSettings . Add ( pl ) ;
963
+ return pl ;
964
+ }
965
+ }
966
+
946
967
public Settings ( )
947
968
{
948
969
ConfigFile = Path . Combine ( DataFolder , "settings.xml" ) ;
@@ -953,6 +974,7 @@ public Settings()
953
974
ImageLoading = false ;
954
975
CameraProperties = new CameraPropertyEnumerator ( ) ;
955
976
DeviceConfigs = new CustomConfigEnumerator ( ) ;
977
+ PluginSettings = new ObservableCollection < PluginSetting > ( ) ;
956
978
ResetSettings ( ) ;
957
979
}
958
980
Original file line number Diff line number Diff line change 294
294
<Compile Include =" Plugins.cs" />
295
295
<Compile Include =" ExportPlugins\ExportToFolder.cs" />
296
296
<Compile Include =" Properties\AssemblyInfo.cs" />
297
+ <Compile Include =" ToolPlugins\EnfusePlugin.cs" />
298
+ <Compile Include =" ToolPlugins\EnfusePluginViewModel.cs" />
299
+ <Compile Include =" ToolPlugins\EnfusePluginWindow.xaml.cs" >
300
+ <DependentUpon >EnfusePluginWindow.xaml</DependentUpon >
301
+ </Compile >
297
302
<Compile Include =" ToolPlugins\GenMoviePlugin.cs" />
298
303
<Compile Include =" ToolPlugins\GenMovieViewModel.cs" />
299
304
<Compile Include =" ToolPlugins\GenMovieWindow.xaml.cs" >
434
439
<Generator >MSBuild:Compile</Generator >
435
440
<SubType >Designer</SubType >
436
441
</Page >
442
+ <Page Include =" ToolPlugins\EnfusePluginWindow.xaml" >
443
+ <SubType >Designer</SubType >
444
+ <Generator >MSBuild:Compile</Generator >
445
+ </Page >
437
446
<Page Include =" ToolPlugins\GenMovieWindow.xaml" >
438
447
<SubType >Designer</SubType >
439
448
<Generator >MSBuild:Compile</Generator >
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ public bool Register()
63
63
ServiceProvider . PluginManager . ToolPlugins . Add ( new GenThumbPlugin ( ) ) ;
64
64
ServiceProvider . PluginManager . ToolPlugins . Add ( new ImageSequencerPlugin ( ) ) ;
65
65
ServiceProvider . PluginManager . ToolPlugins . Add ( new GenMoviePlugin ( ) ) ;
66
+ ServiceProvider . PluginManager . ToolPlugins . Add ( new EnfusePlugin ( ) ) ;
66
67
67
68
ServiceProvider . ExternalDeviceManager . ExternalDevices . Add ( new SerialPortShutterRelease ( ) ) ;
68
69
ServiceProvider . ExternalDeviceManager . ExternalDevices . Add ( new DSUSBShutterRelease ( ) ) ;
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Linq ;
4
+ using System . Text ;
5
+ using System . Threading . Tasks ;
6
+ using CameraControl . Core . Interfaces ;
7
+
8
+ namespace CameraControl . Plugins . ToolPlugins
9
+ {
10
+ public class EnfusePlugin : IToolPlugin
11
+ {
12
+ public bool Execute ( )
13
+ {
14
+ EnfusePluginWindow window = new EnfusePluginWindow ( ) ;
15
+ window . DataContext = new EnfusePluginViewModel ( ) ;
16
+ window . ShowDialog ( ) ;
17
+ return true ;
18
+ }
19
+
20
+ public string Title { get ; set ; }
21
+
22
+ public string Id
23
+ {
24
+ get { return "{2495C316-F222-4AAC-8F2C-65DF524D75CC}" ; }
25
+ }
26
+
27
+ public EnfusePlugin ( )
28
+ {
29
+ Title = "Enfuse" ;
30
+ }
31
+
32
+ }
33
+ }
You can’t perform that action at this time.
0 commit comments