Skip to content

Commit

Permalink
updated SDK and minor implementation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
peterAnyline committed Jun 5, 2018
1 parent 3ae8bf0 commit c8457be
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
</DebugEngines>
<BackgroundTaskDebugEngines>
</BackgroundTaskDebugEngines>
<RemoteDebugMachine>192.168.100.27:4020 (DESKTOP-4E978BE)</RemoteDebugMachine>
<RemoteDebugMachine>DESKTOP-BBCEU9P</RemoteDebugMachine>
<AuthenticationMode>Windows</AuthenticationMode>
<RemoteDebugEnabled>true</RemoteDebugEnabled>
<RemoteDebugEnabled>false</RemoteDebugEnabled>
<CreateCleanLayout>false</CreateCleanLayout>
<UseEmulator>false</UseEmulator>
<DeviceId>6C3DD314-EF85-06D2-68DF-7734EA48770B</DeviceId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@ public ScanEnergyDoubleTariff()

AnylineScanView.SetConfigFromAsset("Modules/Energy/EnergyConfig.json");
AnylineScanView.InitAnyline(MainPage.LicenseKey, this);

AnylineScanView.CameraListener = this;

doubleTariffCutoutView = new DoubleTariffCutoutView();
doubleTariffCutoutView.StrokeWidth = AnylineViewConfig.StrokeWidth;
doubleTariffCutoutView.StrokeBrush = new SolidColorBrush(Color.FromArgb(0, 0, 0, 0));
doubleTariffCutoutView.FillBrush = new SolidColorBrush(Color.FromArgb(60, 255, 255, 255));

RootGrid.Children.Add(doubleTariffCutoutView);
RootGrid.Children.Add(doubleTariffCutoutView);
}


protected override void OnNavigatedTo(NavigationEventArgs args)
{
base.OnNavigatedTo(args);
Expand All @@ -63,7 +63,8 @@ protected override void OnNavigatedFrom(NavigationEventArgs args)

if (AnylineScanView != null)
{
AnylineScanView.CancelScanning();
if (AnylineScanView.IsScanning)
AnylineScanView.CancelScanning();
AnylineScanView.ReleaseCameraInBackground();
}
AnylineScanView = null;
Expand All @@ -74,12 +75,18 @@ private void CutoutView_LayoutUpdated(object sender, object e)
{
if (AnylineScanView == null) return;
var bounds = AnylineScanView.CutoutView.GetBounds();

// we define how we want to shift the 2nd cutout
double verticalDistance = 2 * bounds.Height;

// 1 to draw below, -1 to draw above
int direction = 1 - 2*Convert.ToInt32(isScanningSecondMeter);
doubleTariffCutoutView.UpdateSizeForRect(
new Rect(bounds.X, bounds.Y + direction * verticalDistance, bounds.Width, bounds.Height));
Rect newRect;

if (!isScanningSecondMeter)
newRect = new Rect(bounds.X, bounds.Y + verticalDistance, bounds.Width, bounds.Height);
else
newRect = new Rect(bounds.X, bounds.Y - verticalDistance, bounds.Width, bounds.Height);

doubleTariffCutoutView.UpdateSizeForRect(newRect);
}

#region camera callbacks
Expand Down Expand Up @@ -112,7 +119,8 @@ void IAnylineModuleResultListener<EnergyResult>.OnResult(EnergyResult scanResult

AnylineViewConfig.CutoutOffset = new Point(0, 2 * AnylineScanView.CutoutView.GetBounds().Height);
AnylineScanView.InvokeScanViewUpdate();


// start scanning again
AnylineScanView.StartScanning();
}
else
Expand Down
4 changes: 2 additions & 2 deletions Anyline.dll
Git LFS file not shown
4 changes: 2 additions & 2 deletions AnylineSDK.dll
Git LFS file not shown

0 comments on commit c8457be

Please sign in to comment.