Skip to content

Commit

Permalink
Breaking change : HostMode property removed/moved
Browse files Browse the repository at this point in the history
  • Loading branch information
dukus committed Apr 25, 2018
1 parent a76d146 commit 91bebf8
Show file tree
Hide file tree
Showing 23 changed files with 68 additions and 85 deletions.
8 changes: 0 additions & 8 deletions CameraControl.Core/Classes/CameraPreset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public void Get(ICameraDevice camera)
Add(GetFrom(camera.FocusMode, "FocusMode"));
Add(GetFrom(camera.LiveViewImageZoomRatio, "LiveViewImageZoomRatio"));
Add(new ValuePair {Name = "CaptureInSdRam", Value = camera.CaptureInSdRam.ToString()});
Add(new ValuePair {Name = "HostMode", Value = camera.HostMode.ToString()});
var property = camera.LoadProperties();
Add(new ValuePair { Name = "NoDownload", Value = property.NoDownload.ToString() });
if (camera.AdvancedProperties != null)
Expand Down Expand Up @@ -112,13 +111,6 @@ public void Set(ICameraDevice camera)
{
Log.Debug("Loading preset for "+camera.DisplayName);
camera.IsBusy = true;
if (!string.IsNullOrEmpty(GetValue("HostMode")))
{
bool val;
if (bool.TryParse(GetValue("HostMode"), out val))
camera.HostMode = val;
}

SetTo(camera.Mode, "Mode");
SetTo(camera.CompressionSetting, "CompressionSetting");
SetTo(camera.ExposureCompensation, "ExposureCompensation");
Expand Down
4 changes: 2 additions & 2 deletions CameraControl.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
13 changes: 0 additions & 13 deletions CameraControl.Devices/BaseCameraDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,6 @@ public virtual bool CaptureInSdRam
}
}

protected bool _hostMode;

public virtual bool HostMode
{
get { return _hostMode; }
set
{
_hostMode = value;
NotifyPropertyChanged("HostMode");
}
}

private PropertyValue<long> _isoNumber;

public virtual PropertyValue<long> IsoNumber
Expand Down Expand Up @@ -593,7 +581,6 @@ public virtual string ToStringCameraData()
c.AppendFormat("\n\tBusy..................{0}", IsBusy ? "Yes" : "No");
c.AppendFormat("\n\tHave LiveView.........{0}", HaveLiveView ? "Yes" : "No");
c.AppendFormat("\n\tCapture SDRam.........{0}", CaptureInSdRam ? "Yes" : "No");
c.AppendFormat("\n\tHost Mode.............{0}", HostMode ? "Yes" : "No");
c.AppendFormat("\n\tIs Connected..........{0}", IsConnected ? "Yes" : "No");
c.AppendFormat("\n\tMode..................{0}, {1} focus", Mode?.Value, FocusMode?.Value);
c.AppendFormat("\n\texposure..............{0} f{1} +/-{2}, ISO{3}",
Expand Down
19 changes: 17 additions & 2 deletions CameraControl.Devices/ICameraDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ public interface ICameraDevice
/// </value>
bool CaptureInSdRam { get; set; }

bool HostMode { get; set; }

PropertyValue<long> FNumber { get; set; }
PropertyValue<long> IsoNumber { get; set; }
PropertyValue<long> ShutterSpeed { get; set; }
Expand Down Expand Up @@ -108,6 +106,12 @@ public interface ICameraDevice
/// <returns><c>true</c> if capability supported</returns>
bool GetCapability(CapabilityEnum capabilityEnum);

/// <summary>
/// The current file transfer progress (0-100 %)
/// </summary>
/// <value>
/// The transfer progress.
/// </value>
uint TransferProgress { get; set; }

int Battery { get; set; }
Expand All @@ -126,6 +130,13 @@ public interface ICameraDevice
void CapturePhoto();
void StartRecordMovie();
void StopRecordMovie();
/// <summary>
/// Gets the prohibition condition for the specified operation.
/// If a operation can be executed empty string will returned,
/// Else the error code or error description
/// </summary>
/// <param name="operationEnum">The operation enum.</param>
/// <returns></returns>
string GetProhibitionCondition(OperationEnum operationEnum);
bool GetStatus(OperationEnum operationEnum);
/// <summary>
Expand All @@ -142,6 +153,10 @@ public interface ICameraDevice
void UnLockCamera();
void Close();
void ResetDevice();
/// <summary>
/// Should be called after file tranferred
/// </summary>
/// <param name="o">The o.</param>
void ReleaseResurce(object o);

void TransferFileThumb(object o, string filename);
Expand Down
35 changes: 12 additions & 23 deletions CameraControl.Devices/Nikon/NikonBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -410,22 +410,23 @@ public void SetPictureControl(PictureControl control)
{
}

public override bool HostMode
protected virtual PropertyValue<long> InitHostMode()
{
get { return _hostMode; }
set
var res = new PropertyValue<long>() { Name = "Lock", IsEnabled = true };
res.AddValues("OFF", 0);
res.AddValues("ON", 1);
res.ReloadValues();
res.Value = "OFF";
res.ValueChanged += delegate (object sender, string key, long val)
{
_hostMode = value;
ExecuteWithNoData(CONST_CMD_ChangeCameraMode, (uint) (HostMode ? 1 : 0));
if (Mode != null)
Mode.IsEnabled = HostMode;
ExecuteWithNoData(CONST_CMD_ChangeCameraMode, (uint) (key == "OFF" ? 0 : 1));
Mode.IsEnabled = key == "ON";
GetEvent(null);
ReadDeviceProperties(CONST_PROP_ExposureProgramMode);
NotifyPropertyChanged("HostMode");
}
};
return res;
}


public override bool Init(DeviceDescriptor deviceDescriptor)
{
try
Expand Down Expand Up @@ -486,7 +487,6 @@ public void LoadProperties()
ReadDeviceProperties(CONST_PROP_ExposureIndicateStatus);
AddAditionalProps();
ReInitShutterSpeed();
HostMode = false;
ReadDeviceProperties(CONST_PROP_LiveViewStatus);
_timer.Start();
OnCameraInitDone();
Expand Down Expand Up @@ -528,7 +528,7 @@ public virtual void AddAditionalProps()
AdvancedProperties.Add(HDRSmoothing());
AdvancedProperties.Add(ActiveSlot());
AdvancedProperties.Add(LensSort());

AdvancedProperties.Add(InitHostMode());
try
{
var deviceinfo = LoadDeviceData(ExecuteReadDataEx(0x1001));
Expand Down Expand Up @@ -1101,16 +1101,6 @@ protected void NikonBase_PropertyChanged(object sender, System.ComponentModel.Pr
CONST_PROP_RecordingMedia);
ReadDeviceProperties(CONST_PROP_RecordingMedia);
}
//if (e.PropertyName == "HostMode")
//{
// Thread thread = new Thread(() =>
// {
// ExecuteWithNoData(CONST_CMD_ChangeCameraMode, (uint) (HostMode ? 1 : 0));
// if (Mode != null)
// Mode.IsEnabled = HostMode;
// });
// thread.Start();
//}
}

private void _stillImageDevice_DeviceEvent(object sender, PortableDeviceEventArgs e)
Expand Down Expand Up @@ -2555,7 +2545,6 @@ public override void TransferFileThumb(object o, string filename)
public override string ToStringCameraData()
{
StringBuilder c = new StringBuilder(base.ToString() + "\n\tType..................Nikon(" + ")");
c.AppendFormat("\n\tHost mode.............{0}", HostMode ? "Yes" : "No");
c.AppendFormat("\n\tLiveView:");
c.AppendFormat("\n\t On..................{0}", LiveViewOn ? "Yes" : "No");
c.AppendFormat("\n\t Focus Mode..........{0}", LiveViewFocusMode);
Expand Down
4 changes: 2 additions & 2 deletions CameraControl.Devices/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
4 changes: 2 additions & 2 deletions CameraControl.PluginManager/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
4 changes: 2 additions & 2 deletions CameraControl.Plugins/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
4 changes: 2 additions & 2 deletions CameraControl.ServerTest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
4 changes: 2 additions & 2 deletions CameraControl.Test/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
4 changes: 2 additions & 2 deletions CameraControl.Trigger/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
4 changes: 2 additions & 2 deletions CameraControl/Controls/Controler.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<StackPanel Orientation="Horizontal" Margin="4">
<!--<StackPanel Orientation="Horizontal" Margin="4">
<Label Content="{T:TranslateExtension LabelHostMode}"/>
<ToggleButton IsChecked="{Binding Path=SelectedCameraDevice.HostMode}" Margin="3" Style="{StaticResource MaterialDesignSwitchToggleButton}" />
</StackPanel>
</StackPanel>-->
<ItemsControl Name="listBox1" ItemsSource="{Binding Path=SelectedCameraDevice.AdvancedProperties}" HorizontalAlignment="Stretch" Margin="0">
<ItemsControl.ItemContainerStyle>
<Style TargetType="{x:Type FrameworkElement}">
Expand Down
4 changes: 2 additions & 2 deletions CameraControl/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
4 changes: 2 additions & 2 deletions CameraControlCmd/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,5 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
4 changes: 2 additions & 2 deletions CameraControlRemoteCmd/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
4 changes: 2 additions & 2 deletions Canon.Eos.Framework/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("3a70507d-c50a-47ca-b920-303d687631ec")]
[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
[assembly: InternalsVisibleTo("Canon.Eos.UnitTests")]
4 changes: 2 additions & 2 deletions DccObsPlugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
4 changes: 2 additions & 2 deletions MtpTester/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
4 changes: 2 additions & 2 deletions PhotoBooth/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
4 changes: 2 additions & 2 deletions Plugin.DeviceControl/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
4 changes: 2 additions & 2 deletions PortableDeviceLib/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ You should have received a copy of the GNU Lesser General Public
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
// en utilisant '*', comme indiqué ci-dessous :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
[assembly: InternalsVisibleTo("PortableDeviceLib.Tests")]
4 changes: 2 additions & 2 deletions Setup/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.76.3")]
[assembly: AssemblyFileVersion("2.0.76.3")]
[assembly: AssemblyVersion("2.0.76.4")]
[assembly: AssemblyFileVersion("2.0.76.4")]
6 changes: 3 additions & 3 deletions Setup/wix/Setup.g.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</auto-generated>
-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Product Id="357e0d80-5093-478e-8c11-28b1c72456eb" Name="OBS plugin for digiCamControl" Language="1033" Codepage="Windows-1252" Version="2.0.76.3" UpgradeCode="357e0d80-5093-478e-8c11-28b1a72096e7" Manufacturer="Duka Istvan">
<Product Id="357e0d80-5093-478e-8c11-28b1c72456ec" Name="OBS plugin for digiCamControl" Language="1033" Codepage="Windows-1252" Version="2.0.76.4" UpgradeCode="357e0d80-5093-478e-8c11-28b1a72096e7" Manufacturer="Duka Istvan">
<Package InstallerVersion="200" Compressed="yes" SummaryCodepage="Windows-1252" Languages="1033" InstallScope="perMachine" />
<Media Id="1" Cabinet="OBS_plugin_for_digiCamControl.cab" EmbedCab="yes" />

Expand Down Expand Up @@ -38,8 +38,8 @@
<WixVariable Id="WixUILicenseRtf" Value="D:\devel\vs2010\CameraControl\CameraControl\bin\Debug\Licenses\DigiCamControlLicence.rtf" />

<Upgrade Id="357e0d80-5093-478e-8c11-28b1a72096e7">
<UpgradeVersion Minimum="0.0.0.0" Maximum="2.0.76.3" IncludeMinimum="yes" IncludeMaximum="no" Property="UPGRADEFOUND" />
<UpgradeVersion Minimum="2.0.76.3" IncludeMinimum="no" Property="NEWPRODUCTFOUND" />
<UpgradeVersion Minimum="0.0.0.0" Maximum="2.0.76.4" IncludeMinimum="yes" IncludeMaximum="no" Property="UPGRADEFOUND" />
<UpgradeVersion Minimum="2.0.76.4" IncludeMinimum="no" Property="NEWPRODUCTFOUND" />
</Upgrade>

<Icon Id="app_icon.ico" SourceFile="..\..\..\Setup\logo.ico" />
Expand Down

0 comments on commit 91bebf8

Please sign in to comment.