Skip to content

Commit

Permalink
Fixed app restart issues
Browse files Browse the repository at this point in the history
Minor UI fixes
  • Loading branch information
Rambalac committed May 4, 2017
1 parent 00e6a76 commit ab8dc4c
Show file tree
Hide file tree
Showing 8 changed files with 232 additions and 25 deletions.
186 changes: 186 additions & 0 deletions Core.Tests/CapabilityGH5.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
<?xml version="1.0" encoding ="UTF-8"?>
<camrply>
<result>ok</result>
<comm_proto_ver>2.0</comm_proto_ver>
<productinfo>
<modelname>GH5</modelname>
</productinfo>
<camcmdlist>
<camcmd>tele-normal</camcmd>
<camcmd>tele-fast</camcmd>
<camcmd>wide-normal</camcmd>
<camcmd>wide-fast</camcmd>
<camcmd>poweroff</camcmd>
<camcmd>4kphoto_marking</camcmd>
</camcmdlist>
<camspeclist>
<camspec>touch_command_auto</camspec>
<camspec>oneshot_af_enable</camspec>
<camspec>setting_play_sort_mode_enable</camspec>
<camspec>af_size_change_pinch</camspec>
<camspec>long_expo_disp_B</camspec>
<camspec>geotag_disable</camspec>
<camspec>peaking_flag_use_enable</camspec>
<camspec>menu_notify_enable</camspec>
<camspec>copy_assist_enable</camspec>
<camspec>rating_enable</camspec>
<camspec>slotnum_2</camspec>
</camspeclist>
<asst_disp>
<disp_mag min="300" max="1000"></disp_mag>
<pinp_mag min="300" max="600"></pinp_mag>
</asst_disp>
<crop_disp>
<disp_mag min="100" max="400"></disp_mag>
</crop_disp>
<stopmotiontset model="GH5" version="1.0" date="20161122">
<stopmotionlist>
<videoquality name="4K/30p" value="mp4_30p_100mbps_4k">
<framerate name="30fps" value="30"></framerate>
<framerate name="15fps" value="15"></framerate>
<framerate name="10fps" value="10"></framerate>
<framerate name="7.5fps" value="7.5"></framerate>
<framerate name="6fps" value="6"></framerate>
<framerate name="3fps" value="3"></framerate>
<framerate name="1fps" value="1"></framerate>
</videoquality>
<videoquality name="4K/24p" value="mp4_24p_100mbps_4k">
<framerate name="24fps" value="24"></framerate>
<framerate name="12fps" value="12"></framerate>
<framerate name="8fps" value="8"></framerate>
<framerate name="6fps" value="6"></framerate>
<framerate name="4.8fps" value="4.8"></framerate>
<framerate name="2.4fps" value="2.4"></framerate>
<framerate name="1fps" value="1"></framerate>
</videoquality>
<videoquality name="FHD/60p" value="mp4_60p_28mbps">
<framerate name="60fps" value="60"></framerate>
<framerate name="30fps" value="30"></framerate>
<framerate name="15fps" value="15"></framerate>
<framerate name="10fps" value="10"></framerate>
<framerate name="7.5fps" value="7.5"></framerate>
<framerate name="6fps" value="6"></framerate>
<framerate name="3fps" value="3"></framerate>
<framerate name="1fps" value="1"></framerate>
</videoquality>
<videoquality name="FHD/30p" value="mp4_30p_20mbps">
<framerate name="30fps" value="30"></framerate>
<framerate name="15fps" value="15"></framerate>
<framerate name="10fps" value="10"></framerate>
<framerate name="7.5fps" value="7.5"></framerate>
<framerate name="6fps" value="6"></framerate>
<framerate name="3fps" value="3"></framerate>
<framerate name="1fps" value="1"></framerate>
</videoquality>
<videoquality name="FHD/24p" value="mp4_24p_24mbps">
<framerate name="24fps" value="24"></framerate>
<framerate name="12fps" value="12"></framerate>
<framerate name="8fps" value="8"></framerate>
<framerate name="6fps" value="6"></framerate>
<framerate name="4.8fps" value="4.8"></framerate>
<framerate name="2.4fps" value="2.4"></framerate>
<framerate name="1fps" value="1"></framerate>
</videoquality>
</stopmotionlist>
</stopmotiontset>
<contents_action_info model="GH5" version="1.0" date="20170127">
<container>
<action type="delete" enable="no" />
</container>
<item>
<content mime_type="image/jpeg" panasonic_com_pn="CAM_ORG" >
<action type="playback" enable="yes" panasonic_com_pn="CAM_LRGTN" player="standard" />
<action type="copy_to_sp" enable="yes" />
<action type="upload" enable="yes" />
<action type="3box" enable="no" />
<action type="delete" enable="yes" />
</content>
<content mime_type="application/octet-stream" panasonic_com_pn="CAM_MPO_JPG" >
<action type="playback" enable="yes" panasonic_com_pn="CAM_LRGTN" player="standard" />
<action type="copy_to_sp" enable="yes" />
<action type="upload" enable="yes" />
<action type="3box" enable="no" />
<action type="delete" enable="yes" />
</content>
<content mime_type="application/octet-stream" panasonic_com_pn="CAM_MPO" >
<action type="playback" enable="yes" panasonic_com_pn="CAM_LRGTN" player="standard" />
<action type="copy_to_sp" enable="no" />
<action type="upload" enable="no" />
<action type="3box" enable="no" />
<action type="delete" enable="yes" />
</content>
<content mime_type="application/octet-stream" panasonic_com_pn="CAM_RAW_JPG" >
<action type="playback" enable="yes" panasonic_com_pn="CAM_LRGTN" player="standard" />
<action type="copy_to_sp" enable="yes" />
<action type="upload" enable="yes" />
<action type="3box" enable="no" />
<action type="delete" enable="yes" />
</content>
<content mime_type="application/octet-stream" panasonic_com_pn="CAM_RAW" >
<action type="playback" enable="yes" panasonic_com_pn="CAM_LRGTN" player="standard" />
<action type="copy_to_sp" enable="no" />
<action type="upload" enable="no" />
<action type="3box" enable="no" />
<action type="delete" enable="yes" />
</content>
<content mime_type="application/octet-stream" panasonic_com_pn="CAM_FOCUS_SELECT_MP4" >
<action type="playback" enable="no" player="-" />
<action type="copy_to_sp" enable="no" />
<action type="upload" enable="no" />
<action type="3box" enable="no" />
<action type="delete" enable="yes" />
</content>
<content mime_type="application/octet-stream" panasonic_com_pn="CAM_AVC_MP4_M10P_3744_30P_AAC_10BIT420,CAM_AVC_MP4_M10P_3456_30P_AAC_10BIT420,CAM_AVC_MP4_HP_4096x2160_24P_LPCM_10BIT422,CAM_AVC_MP4_HP_4096x2160_24P_LPCM,CAM_AVC_MP4_HP_2160_30P_LPCM_10BIT422,CAM_AVC_MP4_HP_2160_25P_LPCM_10BIT422,CAM_AVC_MP4_HP_2160_24P_LPCM_10BIT422,CAM_AVC_MP4_HP_2160_60P_LPCM,CAM_AVC_MP4_HP_2160_50P_LPCM,CAM_AVC_MP4_HP_2160_60P_AAC,CAM_AVC_MP4_HP_2160_30P_AAC,CAM_AVC_MP4_HP_2160_25P_AAC,CAM_AVC_MP4_HP_2160_24P_AAC,CAM_AVC_MP4_HP_2336_60P_AAC,CAM_AVC_MP4_HP_2336_30P_AAC,CAM_AVC_MP4_HP_2336_25P_AAC,CAM_AVC_MP4_HP_2496_60P_AAC,CAM_AVC_MP4_HP_2496_30P_AAC,CAM_AVC_MP4_HP_2496_25P_AAC,CAM_AVC_MP4_HP_2880_60P_AAC,CAM_AVC_MP4_HP_2880_30P_AAC,CAM_AVC_MP4_HP_2880_25P_AAC,CAM_AVC_MP4_HP_2160_30P_LPCM,CAM_AVC_MP4_HP_2160_25P_LPCM,CAM_AVC_MP4_HP_2160_24P_LPCM,CAM_AVC_MP4_HP_2496_25P_LPCM_10BIT422,CAM_AVC_MP4_HP_2496_60P_LPCM,CAM_AVC_MP4_HP_2496_50P_LPCM,CAM_AVC_MP4_HP_2496_30P_LPCM,CAM_AVC_MP4_HP_2496_25P_LPCM,CAM_AVC_MP4_HP_2496_24P_LPCM,CAM_AVC_MP4_HP_1080_50P_LPCM_10BIT422,CAM_AVC_MP4_HP_1080_25P_LPCM_10BIT422,CAM_AVC_MP4_HP_1080_60P_LPCM,CAM_AVC_MP4_HP_1080_50P_LPCM,CAM_AVC_MP4_HP_1080_30P_LPCM,CAM_AVC_MP4_HP_1080_25P_LPCM,CAM_AVC_MP4_HP_1080_24P_LPCM" >
<action type="playback" enable="yes" player="liveview" player_func="type1" />
<action type="copy_to_sp" enable="no" />
<action type="upload" enable="no" />
<action type="3box" enable="no" />
<action type="delete" enable="yes" />
</content>
<content mime_type="application/octet-stream" panasonic_com_pn="CAM_AVC_MP4_HP_1080_60P_AAC,CAM_AVC_MP4_HP_1080_50P_AAC,CAM_AVC_MP4_HP_1080_30P_AAC,CAM_AVC_MP4_HP_1080_25P_AAC,CAM_AVC_MP4_HP_1080_24P_AAC" >
<action type="playback" enable="yes" player="liveview" player_func="type1" />
<action type="copy_to_sp" enable="yes" />
<action type="upload" enable="yes" />
<action type="3box" enable="no" />
<action type="delete" enable="yes" />
</content>
<content mime_type="video/mp4" panasonic_com_pn="CAM_AVC_MP4_HP_720_30P_AAC,CAM_AVC_MP4_HP_720_25P_AAC,CAM_AVC_MP4_BL_1080_30P_AAC,CAM_AVC_MP4_BL_1080_25P_AAC,CAM_AVC_MP4_BL_720_30P_AAC,CAM_AVC_MP4_BL_720_25P_AAC,CAM_AVC_MP4_BL_480_30P_AAC,CAM_AVC_MP4_BL_480_25P_AAC" >
<action type="playback" enable="yes" player="liveview" player_func="type1" />
<action type="copy_to_sp" enable="yes" />
<action type="upload" enable="yes" />
<action type="3box" enable="no" />
<action type="delete" enable="yes" />
</content>
<content mime_type="application/octet-stream" panasonic_com_pn="CAM_AVC_TS_HP_1080_60P_AC3,CAM_AVC_TS_HP_1080_50P_AC3" >
<action type="playback" enable="yes" player="liveview" player_func="type1" />
<action type="copy_to_sp" enable="no" />
<action type="upload" enable="no" />
<action type="3box" enable="no" />
<action type="delete" enable="yes" />
</content>
<content mime_type="video/vnd.dlna.mpeg-tts" panasonic_com_pn="CAM_AVC_TS_HP_1080_60I_AC3,CAM_AVC_TS_HP_1080_50I_AC3,CAM_AVC_TS_HP_1080_30P_AC3,CAM_AVC_TS_HP_1080_25P_AC3,CAM_AVC_TS_HP_1080_24P_AC3,CAM_AVC_TS_HP_720_60P_AC3,CAM_AVC_TS_HP_720_50P_AC3,CAM_AVC_TS_HP_720_30P_AAC,CAM_AVC_TS_HP_720_25
65c
P_AAC" >
<action type="playback" enable="yes" player="liveview" player_func="type1" />
<action type="copy_to_sp" enable="no" />
<action type="upload" enable="no" />
<action type="3box" enable="no" />
<action type="delete" enable="yes" />
</content>
<content mime_type="application/octet-stream" panasonic_com_pn="CAM_AVC_MOV_HP_4096x2160_24P_LPCM_10BIT422,CAM_AVC_MOV_HP_4096x2160_24P_LPCM,CAM_AVC_MOV_HP_2160_30P_LPCM_10BIT422,CAM_AVC_MOV_HP_2160_25P_LPCM_10BIT422,CAM_AVC_MOV_HP_2160_24P_LPCM_10BIT422,CAM_AVC_MOV_HP_2160_60P_LPCM,CAM_AVC_MOV_HP_2160_50P_LPCM,CAM_AVC_MOV_HP_2160_30P_LPCM,CAM_AVC_MOV_HP_2160_25P_LPCM,CAM_AVC_MOV_HP_2160_24P_LPCM,CAM_AVC_MOV_HP_2496_60P_LPCM,CAM_AVC_MOV_HP_2496_50P_LPCM,CAM_AVC_MOV_HP_2496_30P_LPCM,CAM_AVC_MOV_HP_2496_25P_LPCM,CAM_AVC_MOV_HP_2496_24P_LPCM,CAM_AVC_MOV_HP_1080_50P_LPCM_10BIT422,CAM_AVC_MOV_HP_1080_25P_LPCM_10BIT422,CAM_AVC_MOV_HP_1080_60P_LPCM,CAM_AVC_MOV_HP_1080_50P_LPCM,CAM_AVC_MOV_HP_1080_30P_LPCM,CAM_AVC_MOV_HP_1080_25P_LPCM,CAM_AVC_MOV_HP_1080_24P_LPCM,CAM_AVC_MOV_HP_720_60P_LPCM,CAM_AVC_MOV_HP_720_50P_LPCM" >
<action type="playback" enable="yes" player="liveview" player_func="type1" />
<action type="copy_to_sp" enable="no" />
<action type="upload" enable="no" />
<action type="3box" enable="no" />
<action type="delete" enable="yes" />
</content>
</item>
</contents_action_info>
<autouploaddirinfo model="GH5" version="1.0" date="20160831">
<autouploaddirlist>
<dir id="dir_id_sd" type="media" detail="sd" title_id="title_sd" >
<dir id="dir_id_sd_auto_upload" type="format" detail="all" object_id="dir_id_sd_auto_upload" />
</dir>
</autouploaddirlist>
</autouploaddirinfo>
</camrply>
3 changes: 3 additions & 0 deletions Core.Tests/Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
<Compile Include="UnitTest.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="CapabilityGH5.xml">
<SubType>Designer</SubType>
</Content>
<Content Include="TestCurMenu.xml" />
<Content Include="TestMenuSetFZ300.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
7 changes: 6 additions & 1 deletion Core/Tools/Log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static void Init(IHttpClient client, string token, string ver, string dev

public static void Stop()
{
cancellation.Cancel();
cancellation?.Cancel();
}

public static void Trace(string message, Severity severity = Severity.Trace, object data = null, string tags = null, [CallerFilePath] string fileName = null, [CallerMemberName] string methodName = null)
Expand Down Expand Up @@ -196,6 +196,10 @@ private static async Task Sender()
Debug.WriteLine(result, "Loggly");
}
}
catch (TaskCanceledException)
{
throw;
}
catch (Exception ex)
{
Debug.WriteLine(ex);
Expand All @@ -205,6 +209,7 @@ private static async Task Sender()
catch (OperationCanceledException)
{
cancellation.Dispose();
cancellation = null;
}
}

Expand Down
41 changes: 26 additions & 15 deletions GMaster/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,37 @@ public App()
{
InitializeComponent();
Suspending += OnSuspending;
Resuming += App_Resuming;
UnhandledException += App_UnhandledException;

Debug.AddCategory("OffFrameBytes", false);
Debug.AddCategory("Discovery", false);
}

private async void App_Resuming(object sender, object e)
{
await OnResuming();
}

private async Task OnResuming()
{
var ver = Package.Current.Id.Version;

var eas = new EasClientDeviceInformation();
var deviceName = string.Concat(eas.SystemProductName.Where(char.IsLetterOrDigit));
if (deviceName == "SystemProductName")
{
deviceName = "PC";
}

Log.Init(new WindowsHttpClient(), "deb4bd35-6ddd-4044-b3e8-ac76330e559b", $"{ver.Major}.{ver.Minor}.{ver.Build}", deviceName, 500);

if (MainModel != null)
{
await MainModel.ConnectionsManager.StartListening();
}
}

public MainPageModel MainModel { get; private set; }

public static async Task<StorageFolder> GetLutsFolder()
Expand All @@ -54,23 +79,9 @@ public static async Task<StorageFolder> GetLutsFolder()
/// <param name="e">Details about the launch request and process.</param>
protected override async void OnLaunched(LaunchActivatedEventArgs e)
{
var ver = Package.Current.Id.Version;

var eas = new EasClientDeviceInformation();
var deviceName = string.Concat(eas.SystemProductName.Where(char.IsLetterOrDigit));
if (deviceName == "SystemProductName")
{
deviceName = "PC";
}

Log.Init(new WindowsHttpClient(), "deb4bd35-6ddd-4044-b3e8-ac76330e559b", $"{ver.Major}.{ver.Minor}.{ver.Build}", deviceName, 500);

MainModel = Resources[nameof(MainModel)] as MainPageModel;

if (MainModel != null)
{
await MainModel.ConnectionsManager.StartListening();
}
await OnResuming();

IfDebug(() =>
{
Expand Down
2 changes: 1 addition & 1 deletion GMaster/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="51338Rambalac.GMaster" Publisher="CN=92765C0E-C69D-491B-9315-91859F5319B9" Version="1.8.2.0" />
<Identity Name="51338Rambalac.GMaster" Publisher="CN=92765C0E-C69D-491B-9315-91859F5319B9" Version="1.8.4.0" />
<mp:PhoneIdentity PhoneProductId="19ca5020-d17a-4012-ad2c-663f57d568c7" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>GMaster</DisplayName>
Expand Down
14 changes: 8 additions & 6 deletions GMaster/Views/CameraViewControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,23 @@
HorizontalContentAlignment="Center"
SelectedItem="{Binding CurrentAperture, Mode=TwoWay}"
Visibility="{Binding CanChangeAperture, Converter={StaticResource TrueToVisibileConverter}}" />
<TextBox HorizontalAlignment="Stretch"
<Border Padding="4" BorderThickness="2" BorderBrush="Gray" Visibility="{Binding CanChangeAperture, Converter={StaticResource FalseToVisibileConverter}}" Background="#22222222">
<TextBlock HorizontalAlignment="Stretch"
Text="{Binding CurrentAperture}"
VerticalAlignment="Stretch" TextAlignment="Center"
Visibility="{Binding CanChangeAperture, Converter={StaticResource FalseToVisibileConverter}}" />
VerticalAlignment="Stretch" TextAlignment="Center"/>
</Border>
</StackPanel>
<StackPanel Width="100" Margin="0,0,10,0">
<ComboBox HorizontalAlignment="Stretch"
ItemsSource="{Binding ShutterSpeeds}"
HorizontalContentAlignment="Center"
SelectedItem="{Binding CurrentShutter, Mode=TwoWay}"
Visibility="{Binding CanChangeShutter, Converter={StaticResource TrueToVisibileConverter}}" />
<TextBox HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
<Border Padding="4" BorderThickness="2" BorderBrush="Gray" Visibility="{Binding CanChangeShutter, Converter={StaticResource FalseToVisibileConverter}}">
<TextBlock HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Text="{Binding CurrentShutter}"
TextAlignment="Center"
Visibility="{Binding CanChangeShutter, Converter={StaticResource FalseToVisibileConverter}}" />
TextAlignment="Center"/>
</Border>
</StackPanel>
<StackPanel Width="100" Margin="0,0,10,0">
<ComboBox HorizontalAlignment="Stretch"
Expand Down
2 changes: 1 addition & 1 deletion GMaster/Views/Models/CameraViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public float BatteryLevel
{
get
{
var numbers = lumixState?.State.Battery.Split('/');
var numbers = lumixState?.State?.Battery?.Split('/');
if (numbers?.Length != 2)
{
return 0;
Expand Down
2 changes: 1 addition & 1 deletion GMaster/_pkginfo.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
E:\Projects\GMaster\GMaster\bin\ARM\Release\Upload\GMaster_1.8.2.0\GMaster_1.8.2.0_x86_x64_arm.appxbundle
E:\Projects\GMaster\GMaster\bin\ARM\Release\Upload\GMaster_1.8.4.0\GMaster_1.8.4.0_x86_x64_arm.appxbundle

0 comments on commit ab8dc4c

Please sign in to comment.