diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-05-10 14:50:37 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-05-10 14:50:37 +0300 |
| commit | f82ae06fbae6d69ea493906feb5ac13b57472b9d (patch) | |
| tree | 0b3c24f69ef85ea590cae7db4b97ca9db9caca3d /Software | |
| parent | e5200c6ba6a1b13525cc1261992ad61b03f93951 (diff) | |
| download | Tango-f82ae06fbae6d69ea493906feb5ac13b57472b9d.tar.gz Tango-f82ae06fbae6d69ea493906feb5ac13b57472b9d.zip | |
MERGE
Diffstat (limited to 'Software')
71 files changed, 943 insertions, 614 deletions
diff --git a/Software/Android_Studio/ColorCapture/app/build.gradle b/Software/Android_Studio/ColorCapture/app/build.gradle index b74f3a18c..495158238 100644 --- a/Software/Android_Studio/ColorCapture/app/build.gradle +++ b/Software/Android_Studio/ColorCapture/app/build.gradle @@ -23,7 +23,7 @@ android { buildTypes { debug { - buildConfigField "String", "WEB_SERVICE_ADDRESS", "\"http://192.168.1.229:45455/api/\"" + buildConfigField "String", "WEB_SERVICE_ADDRESS", "\"http://10.100.102.214:45455/api/\"" buildConfigField "String", "WEB_SERVICE_APP_ID", "\"Tdf793i4ughsiduf8749509237885ehgfdlkghlT\"" } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/AndroidManifest.xml b/Software/Android_Studio/ColorCapture/app/src/main/AndroidManifest.xml index bbea0549e..d21611173 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/AndroidManifest.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/AndroidManifest.xml @@ -28,7 +28,8 @@ android:theme="@style/AppTheme"> <activity android:name=".views.loading.LoadingActivity" - android:noHistory="true"> + android:noHistory="true" + android:screenOrientation="portrait"> <intent-filter> <action android:name="android.intent.action.MAIN" /> @@ -45,8 +46,7 @@ android:host="twine-s.com" /> </intent-filter> </activity> - <activity android:name=".views.main.MainActivity"/> - <activity android:name=".views.sendtoemail.SendToEmailFragment" /> + <activity android:name=".views.main.MainActivity" android:screenOrientation="portrait" /> </application> </manifest>
\ No newline at end of file diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/IMainActivity.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/IMainActivity.java index 0835d4eef..9d1e33fa3 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/IMainActivity.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/IMainActivity.java @@ -4,5 +4,5 @@ import com.twine.colorcapture.mvvm.IView; public interface IMainActivity extends IView { - void cloneMenu(); + void closeMenu(); } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/MainActivity.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/MainActivity.java index 4190175ce..2e6b70c02 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/MainActivity.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/MainActivity.java @@ -129,7 +129,7 @@ public class MainActivity extends ActivityBase<ActivityMainBinding, MainActivity } @Override - public void cloneMenu() + public void closeMenu() { drawerLayout.closeDrawer(Gravity.START); } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/MainActivityVM.java b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/MainActivityVM.java index 23f3e3868..c7c8eb7a1 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/MainActivityVM.java +++ b/Software/Android_Studio/ColorCapture/app/src/main/java/com/twine/colorcapture/views/main/MainActivityVM.java @@ -2,8 +2,6 @@ package com.twine.colorcapture.views.main; import com.squareup.otto.Bus; import com.twine.colorcapture.dialogs.welcome.WelcomeDialog; -import com.twine.colorcapture.integration.ExternalBridgeScanner; -import com.twine.colorcapture.mvvm.DependencyProperty; import com.twine.colorcapture.mvvm.RelayCommand; import com.twine.colorcapture.mvvm.ViewModelBase; import com.twine.colorcapture.navigation.INavigationProvider; @@ -82,7 +80,7 @@ public class MainActivityVM extends ViewModelBase<IMainActivity> private void handleHowToUseCommand() { - view.cloneMenu(); + view.closeMenu(); notificationProvider.showDialog(new WelcomeDialog(), (vm) -> { }); } diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/about.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/about.png Binary files differnew file mode 100644 index 000000000..d5701a483 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/about.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/darkening.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/darkening.png Binary files differnew file mode 100644 index 000000000..f50441f22 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/darkening.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/delete_thin.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/delete_thin.png Binary files differnew file mode 100644 index 000000000..b6b951c0a --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/delete_thin.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/down.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/down.png Binary files differnew file mode 100644 index 000000000..b1e67433d --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/down.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/email.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/email.png Binary files differnew file mode 100644 index 000000000..341d122a6 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/email.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/error.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/error.png Binary files differnew file mode 100644 index 000000000..41fa3df55 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/error.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/got_it.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/got_it.png Binary files differnew file mode 100644 index 000000000..46e9288d6 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/got_it.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/how_to.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/how_to.png Binary files differnew file mode 100644 index 000000000..fbeb31818 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/how_to.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icon.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icon.png Binary files differnew file mode 100644 index 000000000..40e46cd1f --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icon.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icon_twine_card.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icon_twine_card.png Binary files differnew file mode 100644 index 000000000..48e6595fa --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icon_twine_card.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icons_arrow_up.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icons_arrow_up.png Binary files differnew file mode 100644 index 000000000..dc4d23f98 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icons_arrow_up.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icons_close.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icons_close.png Binary files differnew file mode 100644 index 000000000..f4e9e1c50 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icons_close.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icons_delete.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icons_delete.png Binary files differnew file mode 100644 index 000000000..55753d24a --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icons_delete.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icons_rename.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icons_rename.png Binary files differnew file mode 100644 index 000000000..070a2f6e7 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/icons_rename.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/info.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/info.png Binary files differnew file mode 100644 index 000000000..3e33de5a6 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/info.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/logo.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/logo.png Binary files differnew file mode 100644 index 000000000..f6b3bf9be --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/logo.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/more_normal.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/more_normal.png Binary files differnew file mode 100644 index 000000000..a540c41be --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/more_normal.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/more_selected.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/more_selected.png Binary files differnew file mode 100644 index 000000000..60494cce8 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/more_selected.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/my_colors.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/my_colors.png Binary files differnew file mode 100644 index 000000000..2eae175fd --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/my_colors.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/selected.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/selected.png Binary files differnew file mode 100644 index 000000000..e1aa19889 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/selected.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/snapmatch.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/snapmatch.png Binary files differnew file mode 100644 index 000000000..994d77ffe --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/snapmatch.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/success.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/success.png Binary files differnew file mode 100644 index 000000000..50819ef94 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/success.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/twine_card.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/twine_card.png Binary files differnew file mode 100644 index 000000000..4eb5dc787 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/twine_card.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/twine_card_icon.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/twine_card_icon.png Binary files differnew file mode 100644 index 000000000..ff3f1c99c --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/twine_card_icon.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/twine_logo.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/twine_logo.png Binary files differnew file mode 100644 index 000000000..9009dd34a --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/twine_logo.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/twinesnap_normal.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/twinesnap_normal.png Binary files differnew file mode 100644 index 000000000..bf6509ea2 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/twinesnap_normal.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/twinesnap_selected.png b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/twinesnap_selected.png Binary files differnew file mode 100644 index 000000000..f71ff6ea5 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/drawable-sw600dp-mdpi/twinesnap_selected.png diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/activity_loading.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/activity_loading.xml index 4e6183a4a..4adc4b6a2 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/activity_loading.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/activity_loading.xml @@ -58,8 +58,8 @@ android:layout_marginTop="30dp" android:layout_below="@id/imageView2" android:layout_centerInParent="true" - android:layout_width="80dp" - android:layout_height="80dp" + android:layout_width="@dimen/progress_size" + android:layout_height="@dimen/progress_size" android:indeterminate="true" android:indeterminateDuration="500" android:indeterminateDrawable="@drawable/progress_ring_background"/> diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/activity_main.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/activity_main.xml index 7c55188cc..9830c53db 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/activity_main.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/activity_main.xml @@ -37,8 +37,8 @@ <ImageButton android:id="@+id/btnMenu" - android:layout_width="68dp" - android:layout_height="65dp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" android:layout_alignParentStart="true" android:layout_centerVertical="true" android:layout_marginLeft="20dp" @@ -52,8 +52,8 @@ <ImageButton android:id="@+id/imageButton2" - android:layout_width="72dp" - android:layout_height="65dp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" android:layout_alignParentStart="true" android:layout_centerVertical="true" android:background="@drawable/button_transparent_fill_ripple" @@ -67,8 +67,8 @@ <ImageButton android:id="@+id/imageButton3" - android:layout_width="68dp" - android:layout_height="65dp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" android:layout_marginRight="20dp" android:layout_alignParentStart="true" android:layout_centerVertical="true" diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/circle_action_button.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/circle_action_button.xml index 0f34acc8f..30f2a57b6 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/circle_action_button.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/circle_action_button.xml @@ -36,8 +36,8 @@ <com.github.florent37.shapeofview.shapes.RoundRectView android:id="@+id/actionButtonCircle" - android:layout_width="39dp" - android:layout_height="39dp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" bind:shape_roundRect_borderColor="#ffffff" bind:shape_roundRect_borderWidth="0dp" bind:shape_roundRect_bottomLeftRadius="40dp" @@ -49,13 +49,14 @@ <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" + android:padding="5dp" android:background="@drawable/button_gradient_fill"> <ImageView android:id="@+id/circleActionButtonImageView" - android:layout_width="33dp" - android:layout_height="28dp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginTop="2dp" android:src="@drawable/email" /> diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/color_result_item.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/color_result_item.xml index 9be44f3da..139ddc5b3 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/color_result_item.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/color_result_item.xml @@ -34,8 +34,8 @@ <com.github.florent37.shapeofview.shapes.RoundRectView android:id="@+id/resultRect" - android:layout_width="67dp" - android:layout_height="67dp" + android:layout_width="@dimen/result_color_size" + android:layout_height="@dimen/result_color_size" bind:shape_roundRect_borderColor="@android:color/black" bind:shape_roundRect_borderWidth="0dp" bind:shape_roundRect_bottomLeftRadius="5dp" @@ -66,7 +66,7 @@ android:fontFamily="@font/flexo_medium" android:letterSpacing="0.07" android:text="@{result.result.name}" - android:textSize="15.4sp" + android:textSize="@dimen/medium_font_size" tools:text="Nike 100" /> @@ -83,7 +83,7 @@ android:fontFamily="@font/flexo_light" android:letterSpacing="0.07" android:text="RGB:" - android:textSize="15.4sp" /> + android:textSize="@dimen/medium_font_size" /> <android.support.v7.widget.AppCompatTextView android:layout_width="match_parent" @@ -94,7 +94,7 @@ android:layout_marginLeft="5dp" android:text="@{result.result.detectionResponse.getProcessedColor().toString()}" tools:text="200, 100, 0" - android:textSize="15.4sp" /> + android:textSize="@dimen/medium_font_size" /> </LinearLayout> </LinearLayout> </LinearLayout> @@ -110,8 +110,8 @@ </LinearLayout> <FrameLayout - android:layout_width="40dp" - android:layout_height="40dp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" android:layout_gravity="right|center" android:layout_marginRight="10dp" android:layout_marginBottom="10dp"> diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_confirm.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_confirm.xml index 1bad9d630..267b16249 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_confirm.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_confirm.xml @@ -15,8 +15,8 @@ android:background="@color/colorBlueMask"> <RelativeLayout - android:layout_width="313.9dp" - android:layout_height="202.6dp" + android:layout_width="@dimen/dialog_width" + android:layout_height="@dimen/dialog_height" android:layout_centerVertical="true" android:layout_centerHorizontal="true" android:elevation="10dp" @@ -50,7 +50,7 @@ android:fontFamily="@font/flexo_bold" android:gravity="center" android:letterSpacing="0.07" - android:textSize="13.4sp" + android:textSize="@dimen/small_font_size" tools:text="Error title" android:text="@{vm.title}" /> @@ -64,7 +64,7 @@ android:fontFamily="@font/flexo_light" android:gravity="center" android:letterSpacing="0.07" - android:textSize="13.4sp" + android:textSize="@dimen/small_font_size" tools:text="Success message" android:text="@{vm.message}"/> @@ -78,7 +78,7 @@ bind:text="@{vm.confirmText}" bind:command="@{vm.confirmCommand}" tools:text="Delete" - bind:textSize="15.3sp" + bind:textSize="@dimen/medium_font_size" bind:src="@drawable/icons_delete" android:clickable="true" /> diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_error.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_error.xml index eee19cd3b..4e172c584 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_error.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_error.xml @@ -15,8 +15,8 @@ android:background="@color/colorBlueMask"> <RelativeLayout - android:layout_width="313.9dp" - android:layout_height="202.6dp" + android:layout_width="@dimen/dialog_width" + android:layout_height="@dimen/dialog_height" android:layout_centerVertical="true" android:layout_centerHorizontal="true" android:background="@drawable/border_primary_background"> @@ -48,15 +48,15 @@ android:fontFamily="@font/flexo_bold" android:gravity="center" android:letterSpacing="0.07" - android:textSize="13.4sp" + android:textSize="@dimen/small_font_size" tools:text="Error title" android:text="@{vm.title}" /> <ImageView android:id="@+id/progress" - android:layout_width="51dp" - android:layout_height="70dp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" android:layout_marginTop="10dp" android:layout_below="@id/txtTitle" android:layout_centerHorizontal="true" @@ -72,7 +72,7 @@ android:fontFamily="@font/flexo_light" android:gravity="center" android:letterSpacing="0.07" - android:textSize="13.4sp" + android:textSize="@dimen/small_font_size" tools:text="Success message" android:text="@{vm.message}"/> diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_processing.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_processing.xml index 2d891b99b..d2218a018 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_processing.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_processing.xml @@ -17,8 +17,8 @@ <ProgressBar android:id="@+id/progress" android:layout_centerInParent="true" - android:layout_width="80dp" - android:layout_height="80dp" + android:layout_width="@dimen/progress_size" + android:layout_height="@dimen/progress_size" android:indeterminate="true" android:indeterminateDuration="500" android:indeterminateDrawable="@drawable/progress_ring_background"/> @@ -31,7 +31,7 @@ android:layout_height="wrap_content" android:layout_marginTop="20dp" android:gravity="center" - android:textSize="13.4sp" + android:textSize="@dimen/small_font_size" android:letterSpacing="0.07" android:fontFamily="@font/flexo_medium" android:text="@string/processing_message"/> diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_progress.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_progress.xml index 34fe35210..b0cd8215a 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_progress.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_progress.xml @@ -15,8 +15,8 @@ android:background="@color/colorBlueMask"> <RelativeLayout - android:layout_width="313.9dp" - android:layout_height="202.6dp" + android:layout_width="@dimen/dialog_width" + android:layout_height="@dimen/dialog_height" android:layout_centerVertical="true" android:layout_centerHorizontal="true" android:background="@drawable/border_primary_background"> @@ -30,14 +30,14 @@ android:fontFamily="@font/flexo_bold" android:gravity="center" android:letterSpacing="0.07" - android:textSize="13.4sp" + android:textSize="@dimen/small_font_size" tools:text="Progress title" android:text="@{vm.title}" /> <ProgressBar android:id="@+id/progress" - android:layout_width="80dp" - android:layout_height="80dp" + android:layout_width="@dimen/progress_size" + android:layout_height="@dimen/progress_size" android:layout_below="@id/txtTitle" android:layout_centerHorizontal="true" android:layout_marginTop="10dp" @@ -55,7 +55,7 @@ android:fontFamily="@font/flexo_light" android:gravity="center" android:letterSpacing="0.07" - android:textSize="13.4sp" + android:textSize="@dimen/small_font_size" tools:text="Progress message please wait..." android:text="@{vm.message}"/> diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_success.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_success.xml index aa4fb6639..8e6bfb3fc 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_success.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_success.xml @@ -15,8 +15,8 @@ android:background="@color/colorBlueMask"> <RelativeLayout - android:layout_width="313.9dp" - android:layout_height="202.6dp" + android:layout_width="@dimen/dialog_width" + android:layout_height="@dimen/dialog_height" android:layout_centerVertical="true" android:layout_centerHorizontal="true" android:background="@drawable/border_primary_background"> @@ -48,15 +48,15 @@ android:fontFamily="@font/flexo_bold" android:gravity="center" android:letterSpacing="0.07" - android:textSize="13.4sp" + android:textSize="@dimen/small_font_size" tools:text="Success Title" android:text="@{vm.title}" /> <ImageView android:id="@+id/progress" - android:layout_width="51dp" - android:layout_height="70dp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" android:layout_marginTop="10dp" android:layout_below="@id/txtTitle" android:layout_centerHorizontal="true" @@ -72,7 +72,7 @@ android:fontFamily="@font/flexo_light" android:gravity="center" android:letterSpacing="0.07" - android:textSize="13.4sp" + android:textSize="@dimen/small_font_size" tools:text="Success message" android:text="@{vm.message}"/> diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_welcome.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_welcome.xml index bcc964288..44bc25f51 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_welcome.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/dialog_welcome.xml @@ -27,7 +27,8 @@ android:layout_marginLeft="30dp" android:layout_marginRight="30dp" android:layout_marginTop="50dp" - android:layout_marginBottom="100dp"> + android:layout_marginBottom="100dp" + > @@ -38,7 +39,7 @@ android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_margin="30dp" - android:textSize="17.3sp" + android:textSize="@dimen/large_font_size" android:textStyle="bold" android:fontFamily="@font/flexo_bold" android:text="@string/welcome_title" /> @@ -62,7 +63,7 @@ android:layout_marginTop="20dp" android:layout_marginEnd="20dp" android:gravity="center" - android:textSize="15.4sp" + android:textSize="@dimen/medium_font_size" android:letterSpacing="0.08" android:lineSpacingExtra="7.7sp" android:fontFamily="@font/flexo_regular" @@ -75,14 +76,16 @@ <android.support.v7.widget.AppCompatButton android:id="@+id/button" android:layout_width="wrap_content" - android:layout_height="55dp" + android:layout_height="wrap_content" android:layout_alignBottom="@+id/frameLayout" android:layout_centerHorizontal="true" android:layout_marginBottom="-30dp" android:background="@drawable/button_gradient_fill_ripple" android:paddingStart="70dp" android:paddingEnd="70dp" - android:textSize="15.4sp" + android:paddingTop="15dp" + android:paddingBottom="15dp" + android:textSize="@dimen/medium_font_size" android:letterSpacing="0.07" android:textStyle="bold" android:text="@string/welcome_go_button" @@ -97,7 +100,7 @@ android:layout_below="@+id/button" android:layout_centerHorizontal="true" android:layout_marginTop="50dp" - android:textSize="15.4sp" + android:textSize="@dimen/medium_font_size" android:textColor="#ffffff" android:fontFamily="@font/flexo_bold" android:letterSpacing="0.09" diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/external_machine_item.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/external_machine_item.xml index 585829bcb..7d90e715d 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/external_machine_item.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/external_machine_item.xml @@ -18,9 +18,10 @@ <ImageView android:id="@+id/imageView2" - android:layout_width="60dp" - android:layout_height="60dp" - android:scaleType="fitCenter" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:scaleType="fitStart" + android:layout_gravity="center" android:layout_marginRight="10dp" android:src="@drawable/icon" /> @@ -34,7 +35,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@{machine.serialNumber}" - android:textSize="18sp" + android:textSize="@dimen/large_font_size" tools:text="Serial Number" /> <TextView @@ -42,6 +43,7 @@ android:layout_height="wrap_content" android:layout_marginTop="10dp" android:text="@{machine.ipAddress}" + android:textSize="@dimen/small_font_size" tools:text="IP Address" /> </LinearLayout> </LinearLayout> diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_capture.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_capture.xml index a4c4affc8..23de66c2d 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_capture.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_capture.xml @@ -117,14 +117,14 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" - android:textSize="13.4sp" + android:textSize="@dimen/small_font_size" android:fontFamily="@font/flexo_medium" android:text="@string/twine_snap_message" android:visibility="@{vm.isCardDetected ? View.GONE : View.VISIBLE}"/> <ImageView - android:layout_width="51dp" - android:layout_height="70dp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" android:layout_gravity="center" android:src="@drawable/got_it" android:visibility="@{vm.isCardDetected ? View.VISIBLE : View.GONE}"/> diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_mycolors.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_mycolors.xml index 1fdcb2710..40b223a4e 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_mycolors.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_mycolors.xml @@ -28,7 +28,7 @@ android:fontFamily="@font/flexo_bold" android:letterSpacing="0.07" android:text="My colors" - android:textSize="17.3sp" /> + android:textSize="@dimen/large_font_size" /> <ListView android:id="@+id/listResults" diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_register.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_register.xml index 51e174e29..b293c83eb 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_register.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_register.xml @@ -32,7 +32,7 @@ android:letterSpacing="0.07" android:layout_gravity="left|center" android:text="Register your system" - android:textSize="17.3sp" /> + android:textSize="@dimen/large_font_size" /> <android.support.v7.widget.AppCompatButton @@ -41,7 +41,7 @@ android:layout_gravity="right" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textSize="17.3sp" + android:textSize="@dimen/large_font_size" android:letterSpacing="0.07" android:textStyle="bold" android:text="Done" @@ -63,7 +63,7 @@ android:layout_height="wrap_content" android:fontFamily="@font/flexo_light" android:letterSpacing="0.07" - android:textSize="13.4sp" + android:textSize="@dimen/small_font_size" android:text="Machine Serial Number:" /> <android.support.v7.widget.AppCompatEditText @@ -72,7 +72,7 @@ android:layout_marginTop="5dp" android:fontFamily="@font/flexo_light" android:letterSpacing="0.07" - android:textSize="15.4sp" + android:textSize="@dimen/medium_font_size" android:textDirection="ltr" android:inputType="textCapCharacters" android:text="@={vm.serialNumber}"/> diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_rename.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_rename.xml index fb95f1c14..341227a22 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_rename.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_rename.xml @@ -32,7 +32,7 @@ android:letterSpacing="0.07" android:layout_gravity="left|center" android:text="Rename my color" - android:textSize="17.3sp" /> + android:textSize="@dimen/large_font_size" /> <android.support.v7.widget.AppCompatButton @@ -41,7 +41,7 @@ android:layout_gravity="right" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:textSize="17.3sp" + android:textSize="@dimen/large_font_size" android:letterSpacing="0.07" android:textStyle="bold" android:text="Done" @@ -63,7 +63,7 @@ android:layout_height="wrap_content" android:fontFamily="@font/flexo_light" android:letterSpacing="0.07" - android:textSize="13.4sp" + android:textSize="@dimen/small_font_size" android:text="Name this color as:" /> <android.support.v7.widget.AppCompatEditText @@ -73,7 +73,7 @@ android:layout_marginTop="5dp" android:fontFamily="@font/flexo_light" android:letterSpacing="0.07" - android:textSize="15.4sp" + android:textSize="@dimen/medium_font_size" android:textDirection="ltr" android:text="@={vm.name}"/> diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_result.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_result.xml index 8ca28f881..a0716cb13 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_result.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_result.xml @@ -12,119 +12,41 @@ </data> <RelativeLayout - android:id="@+id/result_main_container" android:layout_width="match_parent" android:layout_height="match_parent" + android:gravity="center" android:background="@color/colorDarkBackground" - android:layoutDirection="ltr" - android:paddingLeft="20dp" - android:paddingRight="20dp" - tools:context="com.twine.colorcapture.views.result.ResultFragment"> + android:layoutDirection="ltr"> - <android.support.v7.widget.AppCompatTextView - android:id="@+id/txtTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerHorizontal="true" - android:layout_marginTop="15dp" - android:fontFamily="@font/flexo_bold" - android:gravity="center" - android:letterSpacing="0.07" - android:text="@{vm.colorResult.name}" - android:textSize="17.3sp" /> - - <com.github.florent37.shapeofview.shapes.RoundRectView - android:id="@+id/resultRect" - android:layout_width="match_parent" - android:layout_height="84.5dp" - android:layout_below="@id/txtTitle" - android:layout_marginTop="15dp" - android:elevation="4dp" - bind:shape_roundRect_borderColor="@android:color/black" - bind:shape_roundRect_borderWidth="0dp" - bind:shape_roundRect_bottomLeftRadius="5dp" - bind:shape_roundRect_bottomRightRadius="5dp" - bind:shape_roundRect_topLeftRadius="5dp" - bind:shape_roundRect_topRightRadius="5dp"> - - - <FrameLayout - android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@{vm.detectionResponse.getProcessedColor().getColor()}"/> - - </com.github.florent37.shapeofview.shapes.RoundRectView> - - <LinearLayout - android:id="@+id/rgbContainer" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@id/resultRect" - android:layout_marginTop="15dp" - android:orientation="horizontal"> - - <android.support.v7.widget.AppCompatTextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:fontFamily="@font/flexo_bold" - android:letterSpacing="0.11" - android:text="RGB:" - android:textSize="17.4sp" /> + <RelativeLayout + android:id="@+id/result_main_container" + android:layout_width="@dimen/result_button_width" + android:layout_height="match_parent" + android:background="@color/colorDarkBackground" + android:layoutDirection="ltr" + android:paddingLeft="20dp" + android:paddingRight="20dp" + tools:context="com.twine.colorcapture.views.result.ResultFragment"> <android.support.v7.widget.AppCompatTextView + android:id="@+id/txtTitle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="5dp" + android:layout_centerHorizontal="true" + android:layout_marginTop="15dp" android:fontFamily="@font/flexo_bold" - android:letterSpacing="0.11" - android:text="@{vm.detectionResponse.getProcessedColor().toString()}" - android:textSize="17.4sp" /> - </LinearLayout> - - <FrameLayout - android:id="@+id/frameToggleBtn" - android:layout_width="match_parent" - android:layout_height="25dp" - android:layout_below="@id/rgbContainer" - android:layout_marginTop="15dp"> - - <android.support.v7.widget.AppCompatTextView - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:fontFamily="@font/flexo_light" + android:gravity="center" android:letterSpacing="0.07" - android:text="See how your camera got this" - android:textSize="15.4sp" /> - - <ImageView - android:layout_width="17dp" - android:layout_height="10dp" - android:layout_gravity="right" - android:layout_marginTop="5dp" - android:src="@{vm.isCameraColorToggled ? @drawable/icons_arrow_up : @drawable/down}" /> - - <Button - android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@drawable/button_transparent_fill_ripple" - android:minHeight="0dp" - android:padding="0dp" - bind:command="@{vm.toggleCameraColorCommand}" /> - </FrameLayout> - - <FrameLayout - android:id="@+id/frameCameraRgbContainer" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_below="@id/frameToggleBtn" - android:layout_marginTop="5dp" - android:layout_marginBottom="10dp" - android:visibility="@{vm.isCameraColorToggled ? View.VISIBLE : View.GONE}"> + android:text="@{vm.colorResult.name}" + android:textSize="17.3sp" /> <com.github.florent37.shapeofview.shapes.RoundRectView - android:layout_width="67.2dp" - android:layout_height="59.5dp" + android:id="@+id/resultRect" + android:layout_width="match_parent" + android:layout_height="84.5dp" android:layout_below="@id/txtTitle" + android:layout_marginTop="15dp" + android:elevation="4dp" bind:shape_roundRect_borderColor="@android:color/black" bind:shape_roundRect_borderWidth="0dp" bind:shape_roundRect_bottomLeftRadius="5dp" @@ -136,113 +58,201 @@ <FrameLayout android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@{vm.detectionResponse.getRawColor().getColor()}"/> + android:background="@{vm.detectionResponse.getProcessedColor().getColor()}" /> </com.github.florent37.shapeofview.shapes.RoundRectView> <LinearLayout - android:layout_width="wrap_content" + android:id="@+id/rgbContainer" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_gravity="center|center_horizontal" - android:layout_marginLeft="20dp" + android:layout_below="@id/resultRect" + android:layout_marginTop="15dp" android:orientation="horizontal"> <android.support.v7.widget.AppCompatTextView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:fontFamily="@font/flexo_light" + android:fontFamily="@font/flexo_bold" android:letterSpacing="0.11" android:text="RGB:" - android:textSize="15.4sp" /> + android:textSize="@dimen/large_font_size" /> <android.support.v7.widget.AppCompatTextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="5dp" - android:fontFamily="@font/flexo_light" + android:fontFamily="@font/flexo_bold" android:letterSpacing="0.11" - android:text="@{vm.detectionResponse.getRawColor().toString()}" - android:textSize="15.4sp" /> + android:text="@{vm.detectionResponse.getProcessedColor().toString()}" + android:textSize="@dimen/large_font_size" /> </LinearLayout> - </FrameLayout> + <FrameLayout + android:id="@+id/frameToggleBtn" + android:layout_width="match_parent" + android:layout_height="25dp" + android:layout_below="@id/rgbContainer" + android:layout_marginTop="15dp"> - <FrameLayout - android:layout_width="match_parent" - android:layout_height="2dp" - android:layout_below="@id/frameCameraRgbContainer" - android:background="@drawable/button_gradient_fill"></FrameLayout> + <android.support.v7.widget.AppCompatTextView + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:fontFamily="@font/flexo_light" + android:letterSpacing="0.07" + android:text="See how your camera got this" + android:textSize="@dimen/medium_font_size" /> + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right" + android:layout_marginTop="5dp" + android:src="@{vm.isCameraColorToggled ? @drawable/icons_arrow_up : @drawable/down}" /> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_alignParentBottom="true" - android:orientation="vertical" - android:paddingBottom="20dp" - android:paddingLeft="40dp" - android:paddingRight="40dp"> + <Button + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@drawable/button_transparent_fill_ripple" + android:minHeight="0dp" + android:padding="0dp" + bind:command="@{vm.toggleCameraColorCommand}" /> + </FrameLayout> - <com.twine.colorcapture.controls.CircleActionButton + <FrameLayout + android:id="@+id/frameCameraRgbContainer" android:layout_width="match_parent" android:layout_height="wrap_content" - bind:src="@drawable/email" - bind:text="Email" - android:clickable="true" - bind:command="@{vm.emailCommand}"/> + android:layout_below="@id/frameToggleBtn" + android:layout_marginTop="5dp" + android:layout_marginBottom="10dp" + android:visibility="@{vm.isCameraColorToggled ? View.VISIBLE : View.GONE}"> - <com.twine.colorcapture.controls.CircleActionButton - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="15dp" - bind:src="@drawable/icons_rename" - bind:text="Rename" - android:clickable="true" - bind:command="@{vm.renameCommand}"/> + <com.github.florent37.shapeofview.shapes.RoundRectView + android:layout_width="@dimen/result_color_size" + android:layout_height="@dimen/result_color_size" + android:layout_below="@id/txtTitle" + bind:shape_roundRect_borderColor="@android:color/black" + bind:shape_roundRect_borderWidth="0dp" + bind:shape_roundRect_bottomLeftRadius="5dp" + bind:shape_roundRect_bottomRightRadius="5dp" + bind:shape_roundRect_topLeftRadius="5dp" + bind:shape_roundRect_topRightRadius="5dp"> - <com.twine.colorcapture.controls.CircleActionButton - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="15dp" - bind:src="@drawable/icon" - bind:text=" Send to Machine" - android:clickable="true" - bind:command="@{vm.sendToMachineCommand}" - android:visibility="@{vm.isMachineRegistred ? View.VISIBLE : View.GONE}"/> + + <FrameLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@{vm.detectionResponse.getRawColor().getColor()}" /> + + </com.github.florent37.shapeofview.shapes.RoundRectView> + + <LinearLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center|center_horizontal" + android:layout_marginLeft="20dp" + android:orientation="horizontal"> + + <android.support.v7.widget.AppCompatTextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:fontFamily="@font/flexo_light" + android:letterSpacing="0.11" + android:text="RGB:" + android:textSize="@dimen/medium_font_size" /> + + <android.support.v7.widget.AppCompatTextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="5dp" + android:fontFamily="@font/flexo_light" + android:letterSpacing="0.11" + android:text="@{vm.detectionResponse.getRawColor().toString()}" + android:textSize="@dimen/medium_font_size" /> + </LinearLayout> + + </FrameLayout> <FrameLayout - android:layout_marginLeft="5dp" - android:layout_marginRight="5dp" + android:layout_width="match_parent" + android:layout_height="2dp" + android:layout_below="@id/frameCameraRgbContainer" + android:background="@drawable/button_gradient_fill"></FrameLayout> + + + <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="15dp" - android:visibility="@{vm.isMachineRegistred ? View.GONE : View.VISIBLE}"> + android:layout_alignParentBottom="true" + android:orientation="vertical" + android:paddingLeft="40dp" + android:paddingRight="40dp" + android:paddingBottom="20dp"> - <android.support.v7.widget.AppCompatTextView - android:layout_width="wrap_content" + <com.twine.colorcapture.controls.CircleActionButton + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_gravity="right|center" - android:fontFamily="@font/flexo_bold" - android:letterSpacing="0.07" - android:textSize="15.4sp" - android:text="@string/have_a_twine_system"/> + android:clickable="true" + bind:command="@{vm.emailCommand}" + bind:src="@drawable/email" + bind:text="Email" + bind:textSize="@dimen/medium_font_size" /> - <ImageView - android:layout_width="40dp" - android:layout_height="32dp" - android:layout_gravity="left" - android:src="@drawable/icon" /> + <com.twine.colorcapture.controls.CircleActionButton + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="15dp" + android:clickable="true" + bind:command="@{vm.renameCommand}" + bind:src="@drawable/icons_rename" + bind:text="Rename" + bind:textSize="@dimen/medium_font_size" /> - <Button + <com.twine.colorcapture.controls.CircleActionButton android:layout_width="match_parent" - android:layout_height="30dp" - android:background="@drawable/button_transparent_fill_ripple" - android:minHeight="0dp" - android:padding="0dp" - bind:command="@{vm.registerMachineCommand}" /> + android:layout_height="wrap_content" + android:layout_marginTop="15dp" + android:clickable="true" + android:visibility="@{vm.isMachineRegistred ? View.VISIBLE : View.GONE}" + bind:command="@{vm.sendToMachineCommand}" + bind:src="@drawable/icon" + bind:text=" Send to Machine" + bind:textSize="@dimen/medium_font_size" /> - </FrameLayout> - </LinearLayout> + <FrameLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="5dp" + android:layout_marginTop="15dp" + android:layout_marginRight="5dp" + android:visibility="@{vm.isMachineRegistred ? View.GONE : View.VISIBLE}"> + + <android.support.v7.widget.AppCompatTextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right|center" + android:fontFamily="@font/flexo_bold" + android:letterSpacing="0.07" + android:text="@string/have_a_twine_system" + android:textSize="@dimen/medium_font_size" /> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="left|center" + android:src="@drawable/icon" /> + + <Button + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@drawable/button_transparent_fill_ripple" + android:padding="0dp" + bind:command="@{vm.registerMachineCommand}" /> + + </FrameLayout> + </LinearLayout> + </RelativeLayout> </RelativeLayout> </layout> diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_send_to_email.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_send_to_email.xml index f1c00d44e..f54d9139d 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_send_to_email.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_send_to_email.xml @@ -32,7 +32,7 @@ android:fontFamily="@font/flexo_bold" android:letterSpacing="0.07" android:text="Send To Email" - android:textSize="17.3sp" /> + android:textSize="@dimen/large_font_size" /> <android.support.v7.widget.AppCompatButton android:id="@+id/btnDone" @@ -45,7 +45,7 @@ android:letterSpacing="0.07" android:text="Send" android:textAllCaps="false" - android:textSize="17.3sp" + android:textSize="@dimen/large_font_size" android:textStyle="bold" bind:command="@{vm.sendCommand}" /> @@ -77,11 +77,11 @@ android:letterSpacing="0.07" android:text="Your color is attached" android:textColor="@color/colorPrimaryBackground" - android:textSize="15.4sp" /> + android:textSize="@dimen/medium_font_size" /> <com.github.florent37.shapeofview.shapes.RoundRectView - android:layout_width="80dp" - android:layout_height="80dp" + android:layout_width="@dimen/result_color_size" + android:layout_height="@dimen/result_color_size" android:layout_margin="20dp" bind:shape_roundRect_borderColor="@android:color/black" bind:shape_roundRect_borderWidth="0dp" @@ -142,7 +142,7 @@ android:textDirection="ltr" android:completionThreshold="1" android:theme="@style/Autocomplete" - android:textSize="15.4sp"/> + android:textSize="@dimen/medium_font_size"/> </android.support.design.widget.TextInputLayout> @@ -165,7 +165,7 @@ android:textColor="@color/colorPrimaryBackground" android:textColorHint="@color/text_gray" android:textDirection="ltr" - android:textSize="15.4sp" /> + android:textSize="@dimen/medium_font_size" /> </LinearLayout> </ScrollView> diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_send_to_machine.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_send_to_machine.xml index 6881b50ff..f336c0ba1 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_send_to_machine.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/fragment_send_to_machine.xml @@ -28,7 +28,7 @@ android:fontFamily="@font/flexo_bold" android:letterSpacing="0.07" android:text="Send To Machine" - android:textSize="17.3sp" /> + android:textSize="@dimen/large_font_size" /> <android.support.v7.widget.AppCompatTextView android:id="@+id/txtScanning" @@ -41,7 +41,7 @@ android:fontFamily="@font/flexo_light" android:letterSpacing="0.07" android:text="Scanning your local network..." - android:textSize="15.3sp" /> + android:textSize="@dimen/medium_font_size" /> <ProgressBar android:layout_below="@id/txtScanning" diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/side_menu.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/side_menu.xml index aa20bd3ef..3ee18a1b7 100644 --- a/Software/Android_Studio/ColorCapture/app/src/main/res/layout/side_menu.xml +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/layout/side_menu.xml @@ -30,7 +30,7 @@ android:fontFamily="@font/flexo_bold" android:letterSpacing="0.07" android:text="@string/app_name" - android:textSize="17.3sp" /> + android:textSize="@dimen/large_font_size" /> <FrameLayout @@ -61,7 +61,7 @@ android:fontFamily="@font/flexo_medium" android:letterSpacing="0.06" android:text="About Twine" - android:textSize="15.4sp" /> + android:textSize="@dimen/medium_font_size" /> </LinearLayout> <LinearLayout @@ -106,7 +106,7 @@ android:fontFamily="@font/flexo_medium" android:letterSpacing="0.06" android:text="About SnapMatch" - android:textSize="15.4sp" /> + android:textSize="@dimen/medium_font_size" /> </LinearLayout> <LinearLayout @@ -151,7 +151,7 @@ android:fontFamily="@font/flexo_medium" android:letterSpacing="0.06" android:text="How to use" - android:textSize="15.4sp" /> + android:textSize="@dimen/medium_font_size" /> </LinearLayout> </LinearLayout> @@ -166,14 +166,15 @@ </LinearLayout> <com.twine.colorcapture.controls.CircleActionButton - android:layout_width="match_parent" + android:layout_width="@dimen/result_button_width" + android:layout_centerHorizontal="true" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_marginLeft="20dp" android:layout_marginRight="20dp" android:layout_marginBottom="60dp" bind:text=" Get a twine TTC™ card" - bind:textSize="15.3sp" + bind:textSize="@dimen/medium_font_size" bind:src="@drawable/icon_twine_card" android:clickable="true" /> </RelativeLayout> diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/values-large/fonts.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/values-large/fonts.xml new file mode 100644 index 000000000..86340b463 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/values-large/fonts.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <dimen name="large_font_size">30.3sp</dimen> + <dimen name="medium_font_size">27.4sp</dimen> + <dimen name="small_font_size">24.4sp</dimen> +</resources>
\ No newline at end of file diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/values-large/sizes.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/values-large/sizes.xml new file mode 100644 index 000000000..16bc4e434 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/values-large/sizes.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <dimen name="dialog_width">613.9dp</dimen> + <dimen name="dialog_height">400.6dp</dimen> + <dimen name="progress_size">120dp</dimen> + <dimen name="result_color_size">90dp</dimen> + <dimen name="result_button_width">600dp</dimen> +</resources>
\ No newline at end of file diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/values/fonts.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/values/fonts.xml new file mode 100644 index 000000000..ae78b7eda --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/values/fonts.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <dimen name="large_font_size">17.3sp</dimen> + <dimen name="medium_font_size">15.4sp</dimen> + <dimen name="small_font_size">13.4sp</dimen> +</resources>
\ No newline at end of file diff --git a/Software/Android_Studio/ColorCapture/app/src/main/res/values/sizes.xml b/Software/Android_Studio/ColorCapture/app/src/main/res/values/sizes.xml new file mode 100644 index 000000000..825ac5312 --- /dev/null +++ b/Software/Android_Studio/ColorCapture/app/src/main/res/values/sizes.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <dimen name="dialog_width">313.9dp</dimen> + <dimen name="dialog_height">202.6dp</dimen> + <dimen name="progress_size">80dp</dimen> + <dimen name="result_color_size">67dp</dimen> + <dimen name="result_button_width">-1</dimen> +</resources>
\ No newline at end of file diff --git a/Software/DB/TCC/TCC.mdf b/Software/DB/TCC/TCC.mdf Binary files differindex 5ecfefac1..9af2708f0 100644 --- a/Software/DB/TCC/TCC.mdf +++ b/Software/DB/TCC/TCC.mdf diff --git a/Software/DB/TCC/TCC_log.ldf b/Software/DB/TCC/TCC_log.ldf Binary files differindex 4ad4ff344..a7ddd2be5 100644 --- a/Software/DB/TCC/TCC_log.ldf +++ b/Software/DB/TCC/TCC_log.ldf diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index 1cf86c705..4acfe8d4c 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -188,7 +188,7 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer) status = ERROR_CODE__FILE_NOT_FOUND; }*/ - responseContainer = createContainer(MESSAGE_TYPE__FileChunkUploadResponse, requestContainer->token, false, &response, &file_chunk_upload_response__pack, &file_chunk_upload_response__get_packed_size); + responseContainer = createContainer(MESSAGE_TYPE__FileChunkUploadResponse, requestContainer->token, FileDone, &response, &file_chunk_upload_response__pack, &file_chunk_upload_response__get_packed_size); if (Fresult!= OK) { responseContainer.error = getErrorCode(Fresult); diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c b/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c index 078aa5f53..341a43704 100644 --- a/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c +++ b/Software/Embedded_SW/Embedded/Common/Utilities/Utils.c @@ -43,7 +43,7 @@ void *my_malloc(size_t _size) malloc_time[malloc_index] = msec_millisecondCounter; } */ - if (addr) + if ((addr)&&(_size>400)) { malloc_addr[malloc_index] = addr; malloc_size[malloc_index] = _size; diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 37db3f84c..931b6674f 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -671,14 +671,15 @@ uint32_t AlarmHandling_ControlTrigger(uint32_t IfIndex, uint32_t ReadValue) } void AlarmHandlingSetAlarm(uint32_t AlarmId, bool value) { - AlarmHandlingMessageStruc Message; + AlarmHandlingInternalSetAlarm( AlarmId, value); + /*AlarmHandlingMessageStruc Message; //send message to the Millisec task Message.messageId = AlarmHandlingAlarm; Message.AlarmId = AlarmId; Message.Value = value; if (AlarmHandlingMsgQ != NULL) - Mailbox_post(AlarmHandlingMsgQ , &Message, BIOS_NO_WAIT); + Mailbox_post(AlarmHandlingMsgQ , &Message, BIOS_NO_WAIT);*/ } void AlarmHandlingInternalSetAlarm(uint32_t AlarmId, bool value) { @@ -702,7 +703,7 @@ void AlarmHandlingInternalSetAlarm(uint32_t AlarmId, bool value) AlarmState[Alarm_i].EventPtr->message = AlarmItem[Alarm_i].EventName; AlarmState[Alarm_i].Status = value; } - Report("Alarm ON ", __FILE__,__LINE__,AlarmItem[Alarm_i].EventType, RpMessage, value, Alarm_i); + Report("Alarm ON ", __FILE__,AlarmState[Alarm_i].EventPtr,AlarmItem[Alarm_i].EventType, RpMessage, value, Alarm_i); } else { @@ -1042,7 +1043,7 @@ void SendEventNotifications(void) } response.n_events = 0; - + UInt Key = Task_disable(); for (i = 0;i<MAX_SYSTEM_ALARMS;i++) { if (AlarmState[i].Status == true) @@ -1071,6 +1072,7 @@ void SendEventNotifications(void) else { LOG_ERROR(response.n_events,"events malloc error"); + Task_restore(Key); return; } } @@ -1078,6 +1080,7 @@ void SendEventNotifications(void) { response.events = NULL; } + Task_restore(Key); responseContainer = createAllocatedContainer(MESSAGE_TYPE__StartEventsNotificationResponse, AlarmHandlingToken, false, &response, &start_events_notification_response__pack, &start_events_notification_response__get_packed_size,&alarm_response_buffer); responseContainer.continuous = true; diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 75542744f..cd748fd5c 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -561,11 +561,11 @@ c. Go to step 2.a x Segment.BrushStopsCount. int NumofReadyDispensers = 0; //REPORT_MSG((int)DispenserPrepareControlId, "Prepare Callback"); - DispenserBuildTimeCounter+=eOneSecond; + DispenserBuildTimeCounter+=500; - if (DispenserBuildTimeCounter<=(3*eOneSecond)) + if (DispenserBuildTimeCounter<(2*eOneSecond)) { - REPORT_MSG(DispenserBuildTimeCounter,"waiting 3 seconds for pressure changes"); + REPORT_MSG(DispenserBuildTimeCounter,"waiting 2 seconds for pressure changes"); return OK; } for (i = 0; i < MAX_DYE_DISPENSERS; i++) @@ -573,7 +573,7 @@ c. Go to step 2.a x Segment.BrushStopsCount. //IDS_StopHomeDispenser(i); if (DispenserUsedInJob[i] == true) //we actually should check for all dispensers { - if (GetDispenserPressure(i) > 1.0) + if (GetDispenserPressure(i) > 0.80) NumofReadyDispensers++; } } @@ -632,8 +632,8 @@ c. Go to step 2.a x Segment.BrushStopsCount. } PrepeareSpeed = JobTicket->processparameters->dyeingspeed*JobTicket->processparameters->maxinkuptake*1.30; - REPORT_MSG((int)JobTicket->processparameters->dyeingspeed, "dyeing speed"); - REPORT_MSG((int)JobTicket->processparameters->maxinkuptake, "max ink uptake"); + //REPORT_MSG((int)JobTicket->processparameters->dyeingspeed, "dyeing speed"); + //REPORT_MSG((int)JobTicket->processparameters->maxinkuptake, "max ink uptake"); if (HeaterCheckReady() == true) { @@ -669,7 +669,8 @@ c. Go to step 2.a x Segment.BrushStopsCount. for (i = 0; i < MAX_DYE_DISPENSERS; i++) { dispenserspeed = PrepeareSpeed/MotorsCfg[DispenserIdToMotorId[i]].microstep; - REPORT_MSG((int)dispenserspeed, "Prepare Speed"); + dispenserspeed = 480; + Report("Prepare Speed",__FILE__,__LINE__,i,RpWarning,(int)dispenserspeed,0); //IDS_StopHomeDispenser(i); if (DispenserUsedInJob[i] == true) //we actually should check for all dispensers { @@ -678,7 +679,7 @@ c. Go to step 2.a x Segment.BrushStopsCount. } } DispenserBuildTimeCounter = 0; - DispenserPrepareControlId = AddControlCallback( IDS_Prepare_Callback, eOneSecond,TemplateDataReadCBFunction ,0, 0, 0 ); + DispenserPrepareControlId = AddControlCallback( IDS_Prepare_Callback, 500,TemplateDataReadCBFunction ,0, 0, 0 ); } //******************************************************************************************************************** diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk Binary files differindex 4853e7fb3..666940192 100644 --- a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk +++ b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Properties/Resources.Designer.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Properties/Resources.Designer.cs index 80918eb2e..c401c2134 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Properties/Resources.Designer.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Properties/Resources.Designer.cs @@ -9,6 +9,7 @@ //------------------------------------------------------------------------------ namespace Tango.MachineStudio.ColorCapture.Properties { + using System; /// <summary> @@ -18,7 +19,7 @@ namespace Tango.MachineStudio.ColorCapture.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -37,7 +38,7 @@ namespace Tango.MachineStudio.ColorCapture.Properties { [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { - if ((resourceMan == null)) { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.MachineStudio.ColorCapture.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } @@ -58,5 +59,45 @@ namespace Tango.MachineStudio.ColorCapture.Properties { resourceCulture = value; } } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap bottomLeft { + get { + object obj = ResourceManager.GetObject("bottomLeft", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap bottomRight { + get { + object obj = ResourceManager.GetObject("bottomRight", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap topleft { + get { + object obj = ResourceManager.GetObject("topleft", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// <summary> + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// </summary> + internal static System.Drawing.Bitmap topRight { + get { + object obj = ResourceManager.GetObject("topRight", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Properties/Resources.resx b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Properties/Resources.resx index af7dbebba..2803cb5b3 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Properties/Resources.resx +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Properties/Resources.resx @@ -46,7 +46,7 @@ mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 @@ -60,6 +60,7 @@ : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> @@ -68,9 +69,10 @@ <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" /> + <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> @@ -85,9 +87,10 @@ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> @@ -109,9 +112,22 @@ <value>2.0</value> </resheader> <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="bottomLeft" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Images\bottomLeft.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="bottomRight" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Images\bottomRight.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="topleft" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Images\topleft.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="topRight" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Images\topRight.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> </root>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Tango.MachineStudio.ColorCapture.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Tango.MachineStudio.ColorCapture.csproj index 9f21cadf2..a38db1b53 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Tango.MachineStudio.ColorCapture.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Tango.MachineStudio.ColorCapture.csproj @@ -207,5 +207,8 @@ <Resource Include="Images\topleft.bmp" /> <Resource Include="Images\topRight.bmp" /> </ItemGroup> + <ItemGroup> + <Folder Include="Resources\" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/ViewModels/MainViewVM.cs index 31eec0871..2f8d421cd 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/ViewModels/MainViewVM.cs @@ -117,7 +117,14 @@ namespace Tango.MachineStudio.ColorCapture.ViewModels public ObservableCollection<BenchmarkItem> Benchmarks { get { return _benchmarks; } - set { _benchmarks = value; RaisePropertyChangedAuto(); } + set { _benchmarks = value; RaisePropertyChangedAuto(); OnBenchmarksChanged(); } + } + + private ObservableCollection<Color> emulatedColors; + public ObservableCollection<Color> EmulatedColors + { + get { return emulatedColors; } + set { emulatedColors = value; RaisePropertyChangedAuto(); } } private CaptureConfig _config; @@ -148,6 +155,33 @@ namespace Tango.MachineStudio.ColorCapture.ViewModels set { _barcode = value; RaisePropertyChangedAuto(); } } + private bool _isEmulated; + public bool IsEmulated + { + get { return _isEmulated; } + set { _isEmulated = value; RaisePropertyChangedAuto(); } + } + + private int emulatedR; + public int EmulatedR + { + get { return emulatedR; } + set { emulatedR = value; RaisePropertyChangedAuto(); OnEmulatedColorChanged(); } + } + + private int emulatedG; + public int EmulatedG + { + get { return emulatedG; } + set { emulatedG = value; RaisePropertyChangedAuto(); OnEmulatedColorChanged(); } + } + + private int emulatedB; + public int EmulatedB + { + get { return emulatedB; } + set { emulatedB = value; RaisePropertyChangedAuto(); OnEmulatedColorChanged(); } + } public RelayCommand ImportBenchmarksCommand { get; set; } @@ -163,6 +197,10 @@ namespace Tango.MachineStudio.ColorCapture.ViewModels public RelayCommand SelectTemplateFileCommand { get; set; } + public RelayCommand LiveCommand { get; set; } + + public RelayCommand EmulatedCommand { get; set; } + public MainViewVM() { Config = new CaptureConfig(); @@ -185,6 +223,8 @@ namespace Tango.MachineStudio.ColorCapture.ViewModels SelectSamplesFolderCommand = new RelayCommand(SelectSamplesFolder); SelectBenchmarksFileCommand = new RelayCommand(SelectBenchmarkFile); SelectTemplateFileCommand = new RelayCommand(SelectTemplateFile); + LiveCommand = new RelayCommand(() => IsEmulated = false); + EmulatedCommand = new RelayCommand(() => IsEmulated = true); } public MainViewVM(IVideoCaptureProvider videoProvider, INotificationProvider notificationProvider) : this() @@ -403,13 +443,18 @@ namespace Tango.MachineStudio.ColorCapture.ViewModels } } - private async void OnVideoFrameReceived(object sender, Video.DirectShow.EventArguments.FrameReceivedEventArgs args) + private void OnVideoFrameReceived(object sender, Video.DirectShow.EventArguments.FrameReceivedEventArgs args) { - if (_abort || IsPaused) return; + if (_abort || IsPaused || IsEmulated) return; + PerformDetection(args.BitmapSource); + } + + private async void PerformDetection(BitmapSource source) + { if (_cardDetector.CanDetect) { - var result = await _cardDetector.Detect(args.BitmapSource, new CardDetectionConfig() + var result = await _cardDetector.Detect(source, new CardDetectionConfig() { Benchmarks = Benchmarks.ToList().Select(x => x.ToDetectionBenchmark()).ToList(), Columns = Config.Columns, @@ -539,5 +584,79 @@ namespace Tango.MachineStudio.ColorCapture.ViewModels return _deltaEComparison; } + + private void OnBenchmarksChanged() + { + EmulatedColors = new ObservableCollection<Color>(); + + if (Benchmarks != null) + { + foreach (var mark in Benchmarks) + { + EmulatedColors.Add(Color.FromRgb((byte)mark.Red, (byte)mark.Green, (byte)mark.Blue)); + } + + OnEmulatedColorChanged(); + } + } + + private void OnEmulatedColorChanged() + { + if (EmulatedColors != null && EmulatedColors.Count > Config.TargetIndex) + { + Color color = Color.FromRgb((byte)EmulatedR, (byte)EmulatedG, (byte)EmulatedB); + EmulatedColors[Config.TargetIndex] = color; + + if (IsEmulated) + { + DetectionOutput output = new DetectionOutput(); + output.ColorMatrix.AddRange(EmulatedColors.Select(x => new DetectionColor() + { + R = x.R, + G = x.G, + B = x.B, + })); + output.ProcessedColor = new DetectionColor() + { + R = EmulatedR, + G = EmulatedG, + B = EmulatedB, + }; + + var bitmap = ColorDetector.DetectionOutputToImage(new DetectionInput() + { + Columns = Config.Columns, + Rows = Config.Rows, + TargetIndex = Config.TargetIndex + + }, output, Config.SampleWidth, Config.SampleHeight, true, true, false); + + float rectWidth = (bitmap.Width / Config.Columns) - 4; + float rectHeight = (bitmap.Height / Config.Rows) - 4; + + using (System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmap)) + { + g.DrawImage(Properties.Resources.topleft, new System.Drawing.RectangleF(0, 0, rectWidth, rectHeight)); + g.DrawImage(Properties.Resources.topRight, new System.Drawing.RectangleF(bitmap.Width - rectWidth, 0, rectWidth, rectHeight)); + + g.DrawImage(Properties.Resources.bottomLeft, new System.Drawing.RectangleF(0, bitmap.Height - rectHeight, rectWidth, rectHeight)); + g.DrawImage(Properties.Resources.bottomRight, new System.Drawing.RectangleF(bitmap.Width - rectWidth, bitmap.Height - rectHeight, rectWidth, rectHeight)); + } + + var bitmapContainer = new System.Drawing.Bitmap(640, 480); + using (System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmapContainer)) + { + g.Clear(System.Drawing.Color.White); + g.DrawImageUnscaled(bitmap, (bitmapContainer.Width / 2) - bitmap.Width / 2, (bitmapContainer.Height / 2) - bitmap.Height / 2); + } + + bitmap.Dispose(); + + PerformDetection(bitmapContainer.ToBitmapSource()); + + bitmapContainer.Dispose(); + } + } + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Views/MainView.xaml index afdac7e18..616bdcfed 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorCapture/Views/MainView.xaml @@ -68,106 +68,150 @@ </TextBlock> </DataTemplate> </TabItem.HeaderTemplate> + <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="600"/> - <RowDefinition Height="1*"/> - </Grid.RowDefinitions> <Grid> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="800"/> - <ColumnDefinition Width="200"/> - <ColumnDefinition Width="1*"/> - </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="600"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="800"/> + <ColumnDefinition Width="200"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> - <Border RenderOptions.BitmapScalingMode="Fant"> - <Grid> - <DockPanel> - <DockPanel DockPanel.Dock="Top" TextElement.FontSize="16"> - <TextBlock VerticalAlignment="Center" Foreground="{StaticResource AccentColorBrush}" FontWeight="SemiBold">Capture Device</TextBlock> - <Button DockPanel.Dock="Right" Command="{Binding ToggleCameraCommand}" CommandParameter="{Binding}" Style="{StaticResource MaterialDesignFlatButton}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Width="50" Height="50" Padding="0"> - <materialDesign:PackIcon Width="40" Height="40"> - <materialDesign:PackIcon.Style> - <Style TargetType="materialDesign:PackIcon"> - <Setter Property="Kind" Value="Play"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding SelectedVideoDevice.IsStarted}" Value="True"> - <Setter Property="Kind" Value="Stop"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding SelectedVideoDevice.IsStarted}" Value="False"> - <Setter Property="Kind" Value="Play"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding IsPaused}" Value="True"> + <Border RenderOptions.BitmapScalingMode="Fant"> + <Grid> + <Grid> + <DockPanel> + <DockPanel DockPanel.Dock="Top" TextElement.FontSize="16"> + <TextBlock VerticalAlignment="Center" Foreground="{StaticResource AccentColorBrush}" FontWeight="SemiBold">Capture Device</TextBlock> + <Button DockPanel.Dock="Right" Command="{Binding ToggleCameraCommand}" CommandParameter="{Binding}" Style="{StaticResource MaterialDesignFlatButton}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Width="50" Height="50" Padding="0"> + <materialDesign:PackIcon Width="40" Height="40"> + <materialDesign:PackIcon.Style> + <Style TargetType="materialDesign:PackIcon"> <Setter Property="Kind" Value="Play"></Setter> - <DataTrigger.EnterActions> - <BeginStoryboard x:Name="blink"> - <Storyboard> - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Duration="00:00:01" RepeatBehavior="Forever"> - <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="0" /> - <DiscreteDoubleKeyFrame KeyTime="00:00:0.5" Value="1" /> - </DoubleAnimationUsingKeyFrames> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <RemoveStoryboard BeginStoryboardName="blink" /> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </materialDesign:PackIcon.Style> - </materialDesign:PackIcon> - </Button> - <ComboBox FontWeight="SemiBold" Margin="20 0" ItemsSource="{Binding VideoProvider.AvailableCaptureDevices}" SelectedItem="{Binding SelectedVideoDevice}" DisplayMemberPath="Device" BorderBrush="{StaticResource Foreground}"></ComboBox> - </DockPanel> + <Style.Triggers> + <DataTrigger Binding="{Binding SelectedVideoDevice.IsStarted}" Value="True"> + <Setter Property="Kind" Value="Stop"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding SelectedVideoDevice.IsStarted}" Value="False"> + <Setter Property="Kind" Value="Play"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding IsPaused}" Value="True"> + <Setter Property="Kind" Value="Play"></Setter> + <DataTrigger.EnterActions> + <BeginStoryboard x:Name="blink"> + <Storyboard> + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Duration="00:00:01" RepeatBehavior="Forever"> + <DiscreteDoubleKeyFrame KeyTime="00:00:00" Value="0" /> + <DiscreteDoubleKeyFrame KeyTime="00:00:0.5" Value="1" /> + </DoubleAnimationUsingKeyFrames> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <RemoveStoryboard BeginStoryboardName="blink" /> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </materialDesign:PackIcon.Style> + </materialDesign:PackIcon> + </Button> + <ComboBox FontWeight="SemiBold" Margin="20 0" ItemsSource="{Binding VideoProvider.AvailableCaptureDevices}" SelectedItem="{Binding SelectedVideoDevice}" DisplayMemberPath="Device" BorderBrush="{StaticResource Foreground}"></ComboBox> + </DockPanel> - <Border Padding="2" Background="{StaticResource LightBackground}" BorderThickness="1" BorderBrush="{StaticResource Accent}" Margin="0 10 0 0"> - <Grid> - <Image Source="{Binding SelectedVideoDevice.VideoSource,Mode=OneWay,IsAsync=True}" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"> - <Image.Style> - <Style TargetType="Image"> - <Setter Property="Visibility" Value="Hidden"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding SelectedVideoDevice.IsStarted}" Value="True"> - <Setter Property="Visibility" Value="Visible"></Setter> - </DataTrigger> - <DataTrigger Binding="{Binding SelectedVideoDevice.IsStarted}" Value="False"> + <Border Padding="2" Background="{StaticResource LightBackground}" BorderThickness="1" BorderBrush="{StaticResource Accent}" Margin="0 10 0 0"> + <Grid> + <Image Source="{Binding SelectedVideoDevice.VideoSource,Mode=OneWay,IsAsync=True}" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"> + <Image.Style> + <Style TargetType="Image"> <Setter Property="Visibility" Value="Hidden"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </Image.Style> - </Image> + <Style.Triggers> + <DataTrigger Binding="{Binding SelectedVideoDevice.IsStarted}" Value="True"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding SelectedVideoDevice.IsStarted}" Value="False"> + <Setter Property="Visibility" Value="Hidden"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Image.Style> + </Image> - <Border HorizontalAlignment="Center" VerticalAlignment="Bottom" Padding="40 10" CornerRadius="20" Margin="20" Visibility="{Binding SelectedVideoDevice.IsStarted,Converter={StaticResource BoolToVisConverter}}"> - <Border.Background> - <SolidColorBrush Color="Black" Opacity="0.5"></SolidColorBrush> - </Border.Background> + <Border HorizontalAlignment="Center" VerticalAlignment="Bottom" Padding="40 10" CornerRadius="20" Margin="20" Visibility="{Binding SelectedVideoDevice.IsStarted,Converter={StaticResource BoolToVisConverter}}"> + <Border.Background> + <SolidColorBrush Color="Black" Opacity="0.5"></SolidColorBrush> + </Border.Background> - <TextBlock Foreground="{StaticResource Accent}"> - <TextBlock.Style> - <Style TargetType="TextBlock"> - <Setter Property="Text" Value="Scanning..."></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IsPaused}" Value="True"> - <Setter Property="Text" Value="Card captured. Press 'play 'to resume scanning."></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </TextBlock.Style> - </TextBlock> + <TextBlock Foreground="{StaticResource Accent}"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Text" Value="Scanning..."></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsPaused}" Value="True"> + <Setter Property="Text" Value="Card captured. Press 'play 'to resume scanning."></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + </Border> + </Grid> </Border> + </DockPanel> + </Grid> + + <Grid Visibility="{Binding IsEmulated,Converter={StaticResource BoolToVisConverter}}"> + <Grid.RowDefinitions> + <RowDefinition Height="60"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + + <Grid Background="{StaticResource Background}"> + </Grid> - </Border> - </DockPanel> - </Grid> - </Border> - <Grid Grid.Column="1"> - <DockPanel Margin="20 130 20 20" VerticalAlignment="Top"> - <TextBlock DockPanel.Dock="Top" FontSize="14" HorizontalAlignment="Center" FontWeight="SemiBold" Foreground="{StaticResource Accent}">Similarity</TextBlock> - <Viewbox Margin="0 10 0 0"> - <gauge:CircularGaugeControl + <Grid Background="{StaticResource LightBackground}" Grid.Row="1" Margin="1"> + <Border HorizontalAlignment="Center" VerticalAlignment="Center" BorderThickness="1" BorderBrush="{StaticResource Accent}" Padding="20" Background="{StaticResource Background}"> + <StackPanel Orientation="Horizontal"> + <Border BorderThickness="1" BorderBrush="{StaticResource Accent}"> + <controls:ColorMatrixControl Colors="{Binding EmulatedColors,Mode=OneWay}" Width="200" Height="210" Columns="10" Rows="11" Background="{StaticResource LightBackground}" /> + </Border> + + <UniformGrid Columns="3" Width="150" Height="200" Margin="40 0 0 0"> + <DockPanel> + <TextBlock Foreground="{StaticResource Red}" DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="0 0 0 5" Text="{Binding EmulatedR,FallbackValue=0}"></TextBlock> + <TextBlock Foreground="{StaticResource Red}" HorizontalAlignment="Center" DockPanel.Dock="Bottom" Margin="0 5 0 0">R</TextBlock> + <Slider Foreground="{StaticResource Red}" Orientation="Vertical" HorizontalAlignment="Center" Minimum="0" IsSnapToTickEnabled="True" TickFrequency="1" Maximum="255" Value="{Binding EmulatedR,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel> + <TextBlock Foreground="{StaticResource Green}" DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="0 0 0 5" Text="{Binding EmulatedG,FallbackValue=0}"></TextBlock> + <TextBlock Foreground="{StaticResource Green}" HorizontalAlignment="Center" DockPanel.Dock="Bottom" Margin="0 5 0 0">G</TextBlock> + <Slider Foreground="{StaticResource Green}" Orientation="Vertical" HorizontalAlignment="Center" Minimum="0" IsSnapToTickEnabled="True" TickFrequency="1" Maximum="255" Value="{Binding EmulatedG,Mode=TwoWay}"></Slider> + </DockPanel> + <DockPanel> + <TextBlock Foreground="{StaticResource Blue}" DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="0 0 0 5" Text="{Binding EmulatedB,FallbackValue=0}"></TextBlock> + <TextBlock Foreground="{StaticResource Blue}" HorizontalAlignment="Center" DockPanel.Dock="Bottom" Margin="0 5 0 0">B</TextBlock> + <Slider Foreground="{StaticResource Blue}" Orientation="Vertical" HorizontalAlignment="Center" Minimum="0" IsSnapToTickEnabled="True" TickFrequency="1" Maximum="255" Value="{Binding EmulatedB,Mode=TwoWay}"></Slider> + </DockPanel> + </UniformGrid> + + </StackPanel> + </Border> + </Grid> + </Grid> + </Grid> + </Border> + + <Grid Grid.Column="1"> + <DockPanel Margin="20 130 20 20" VerticalAlignment="Top"> + <TextBlock DockPanel.Dock="Top" FontSize="14" HorizontalAlignment="Center" FontWeight="SemiBold" Foreground="{StaticResource Accent}">Similarity</TextBlock> + <Viewbox Margin="0 10 0 0"> + <gauge:CircularGaugeControl Radius="150" ScaleRadius="110" ScaleStartAngle="120" @@ -204,252 +248,288 @@ DialTextColor="Black" > - </gauge:CircularGaugeControl> - </Viewbox> - </DockPanel> - </Grid> + </gauge:CircularGaugeControl> + </Viewbox> + </DockPanel> + </Grid> - <Grid Grid.Column="2" Margin="0 60 0 0" HorizontalAlignment="Left"> - <Grid.RowDefinitions> - <RowDefinition Height="180*"/> - <RowDefinition Height="130*"/> - </Grid.RowDefinitions> - <Grid> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="500"/> - <ColumnDefinition Width="1*"/> - </Grid.ColumnDefinitions> + <Grid Grid.Column="2" Margin="0 60 0 0" HorizontalAlignment="Left"> + <Grid.RowDefinitions> + <RowDefinition Height="180*"/> + <RowDefinition Height="130*"/> + </Grid.RowDefinitions> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="500"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> - <TextBlock Margin="0 -20 0 0" FontWeight="SemiBold" Foreground="{StaticResource Accent}">Rectified Image</TextBlock> - <Border Padding="2" Background="{StaticResource LightBackground}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="300" Height="310" BorderThickness="1" BorderBrush="{StaticResource Accent}"> - <Image Source="{Binding DetectedSource,Mode=OneWay,IsAsync=True}" Stretch="Fill"></Image> - </Border> + <TextBlock Margin="0 -20 0 0" FontWeight="SemiBold" Foreground="{StaticResource Accent}">Rectified Image</TextBlock> + <Border Padding="2" Background="{StaticResource LightBackground}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="300" Height="310" BorderThickness="1" BorderBrush="{StaticResource Accent}"> + <Image Source="{Binding DetectedSource,Mode=OneWay,IsAsync=True}" Stretch="Fill"></Image> + </Border> - <TextBlock Grid.Column="1" Margin="0 -20 0 0" FontWeight="SemiBold" Foreground="{StaticResource Accent}">Calculated Averages</TextBlock> - <Border Padding="2" HorizontalAlignment="Left" Grid.Column="1" VerticalAlignment="Top" Width="300" Height="310" BorderThickness="1" BorderBrush="{StaticResource Accent}"> - <controls:ColorMatrixControl Colors="{Binding Colors,Mode=OneWay}" Columns="10" Rows="11" Background="{StaticResource LightBackground}" /> - </Border> - </Grid> + <TextBlock Grid.Column="1" Margin="0 -20 0 0" FontWeight="SemiBold" Foreground="{StaticResource Accent}">Calculated Averages</TextBlock> + <Border Padding="2" HorizontalAlignment="Left" Grid.Column="1" VerticalAlignment="Top" Width="300" Height="310" BorderThickness="1" BorderBrush="{StaticResource Accent}"> + <controls:ColorMatrixControl Colors="{Binding Colors,Mode=OneWay}" Columns="10" Rows="11" Background="{StaticResource LightBackground}" /> + </Border> + </Grid> - <Grid Grid.Row="1"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="500"/> - <ColumnDefinition Width="1*"/> - </Grid.ColumnDefinitions> + <Grid Grid.Row="1"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="500"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> - <Grid Height="120" VerticalAlignment="Top" HorizontalAlignment="Left"> - <DockPanel> - <TextBlock Margin="0 10 0 0" DockPanel.Dock="Top" Foreground="{StaticResource AccentColorBrush}" FontWeight="SemiBold" FontSize="16">Captured Color</TextBlock> - <DockPanel Margin="0 5 0 0" TextElement.FontSize="16"> - <UniformGrid DockPanel.Dock="Right" Rows="3" Margin="10 0 0 0" Width="55"> - <TextBlock Foreground="{StaticResource Red}"><Run Text="R:"></Run> <Run FontWeight="SemiBold" FontStyle="Italic" Text="{Binding CapturedColor.R,Mode=OneWay}"></Run></TextBlock> - <TextBlock Foreground="{StaticResource Green}"><Run Text="G:"></Run> <Run FontWeight="SemiBold" FontStyle="Italic" Text="{Binding CapturedColor.G,Mode=OneWay}"></Run></TextBlock> - <TextBlock Foreground="{StaticResource Blue}"><Run Text="B:"></Run> <Run FontWeight="SemiBold" FontStyle="Italic" Text="{Binding CapturedColor.B,Mode=OneWay}"></Run></TextBlock> - </UniformGrid> - <Border Padding="2" Width="300" BorderThickness="1" BorderBrush="{StaticResource Accent}" Background="{StaticResource LightBackground}"> - <Rectangle> - <Rectangle.Fill> - <SolidColorBrush Color="{Binding CapturedColor,Mode=OneWay}" /> - </Rectangle.Fill> - </Rectangle> - </Border> + <Grid Height="120" VerticalAlignment="Top" HorizontalAlignment="Left"> + <DockPanel> + <TextBlock Margin="0 10 0 0" DockPanel.Dock="Top" Foreground="{StaticResource AccentColorBrush}" FontWeight="SemiBold" FontSize="16">Captured Color</TextBlock> + <DockPanel Margin="0 5 0 0" TextElement.FontSize="16"> + <UniformGrid DockPanel.Dock="Right" Rows="3" Margin="10 0 0 0" Width="55"> + <TextBlock Foreground="{StaticResource Red}"><Run Text="R:"></Run> <Run FontWeight="SemiBold" FontStyle="Italic" Text="{Binding CapturedColor.R,Mode=OneWay}"></Run></TextBlock> + <TextBlock Foreground="{StaticResource Green}"><Run Text="G:"></Run> <Run FontWeight="SemiBold" FontStyle="Italic" Text="{Binding CapturedColor.G,Mode=OneWay}"></Run></TextBlock> + <TextBlock Foreground="{StaticResource Blue}"><Run Text="B:"></Run> <Run FontWeight="SemiBold" FontStyle="Italic" Text="{Binding CapturedColor.B,Mode=OneWay}"></Run></TextBlock> + </UniformGrid> + <Border Padding="2" Width="300" BorderThickness="1" BorderBrush="{StaticResource Accent}" Background="{StaticResource LightBackground}"> + <Rectangle> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding CapturedColor,Mode=OneWay}" /> + </Rectangle.Fill> + </Rectangle> + </Border> + </DockPanel> </DockPanel> - </DockPanel> - </Grid> + </Grid> - <Grid Height="120" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Column="1"> - <DockPanel> - <TextBlock Margin="0 10 0 0" DockPanel.Dock="Top" Foreground="{StaticResource AccentColorBrush}" FontWeight="SemiBold" FontSize="16">Processed Color</TextBlock> - <DockPanel Margin="0 5 0 0" TextElement.FontSize="16"> - <UniformGrid DockPanel.Dock="Right" Rows="3" Margin="10 0 0 0" Width="55"> - <TextBlock Foreground="{StaticResource Red}"><Run Text="R:"></Run> <Run FontWeight="SemiBold" FontStyle="Italic" Text="{Binding ProcessedColor.R,Mode=OneWay}"></Run></TextBlock> - <TextBlock Foreground="{StaticResource Green}"><Run Text="G:"></Run> <Run FontWeight="SemiBold" FontStyle="Italic" Text="{Binding ProcessedColor.G,Mode=OneWay}"></Run></TextBlock> - <TextBlock Foreground="{StaticResource Blue}"><Run Text="B:"></Run> <Run FontWeight="SemiBold" FontStyle="Italic" Text="{Binding ProcessedColor.B,Mode=OneWay}"></Run></TextBlock> - </UniformGrid> - <Border Padding="2" Width="300" BorderThickness="1" BorderBrush="{StaticResource Accent}" Background="{StaticResource LightBackground}"> - <Rectangle> - <Rectangle.Fill> - <SolidColorBrush Color="{Binding ProcessedColor,Mode=OneWay}" /> - </Rectangle.Fill> - </Rectangle> - </Border> + <Grid Height="120" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Column="1"> + <DockPanel> + <TextBlock Margin="0 10 0 0" DockPanel.Dock="Top" Foreground="{StaticResource AccentColorBrush}" FontWeight="SemiBold" FontSize="16">Processed Color</TextBlock> + <DockPanel Margin="0 5 0 0" TextElement.FontSize="16"> + <UniformGrid DockPanel.Dock="Right" Rows="3" Margin="10 0 0 0" Width="55"> + <TextBlock Foreground="{StaticResource Red}"><Run Text="R:"></Run> <Run FontWeight="SemiBold" FontStyle="Italic" Text="{Binding ProcessedColor.R,Mode=OneWay}"></Run></TextBlock> + <TextBlock Foreground="{StaticResource Green}"><Run Text="G:"></Run> <Run FontWeight="SemiBold" FontStyle="Italic" Text="{Binding ProcessedColor.G,Mode=OneWay}"></Run></TextBlock> + <TextBlock Foreground="{StaticResource Blue}"><Run Text="B:"></Run> <Run FontWeight="SemiBold" FontStyle="Italic" Text="{Binding ProcessedColor.B,Mode=OneWay}"></Run></TextBlock> + </UniformGrid> + <Border Padding="2" Width="300" BorderThickness="1" BorderBrush="{StaticResource Accent}" Background="{StaticResource LightBackground}"> + <Rectangle> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding ProcessedColor,Mode=OneWay}" /> + </Rectangle.Fill> + </Rectangle> + </Border> + </DockPanel> </DockPanel> - </DockPanel> - <TextBlock Margin="0 0 0 -20" VerticalAlignment="Bottom"> + <TextBlock Margin="0 0 0 -20" VerticalAlignment="Bottom"> <Run>Barcode:</Run> <Run Text="{Binding Barcode}" FontWeight="SemiBold" FontStyle="Italic"></Run> - </TextBlock> - </Grid> + </TextBlock> + </Grid> - <DockPanel VerticalAlignment="Bottom" Grid.ColumnSpan="2" TextElement.FontSize="16"> - <TextBlock HorizontalAlignment="Center" Foreground="{StaticResource AccentColorBrush}" FontWeight="SemiBold" FontSize="16">Delta E Reference Point</TextBlock> - <UniformGrid Columns="3" Margin="20 0 70 0"> - <DockPanel> - <TextBlock FontWeight="SemiBold">L:</TextBlock> - <mahapps:NumericUpDown BorderBrush="{StaticResource BorderBrush}" MinWidth="120" HorizontalContentAlignment="Left" Value="{Binding MeasureL,UpdateSourceTrigger=PropertyChanged}" Minimum="0" Maximum="100" Margin="5 0 0 0" HasDecimals="True" HideUpDownButtons="True" Background="{StaticResource LightBackground}" FontSize="16" Foreground="{StaticResource Accent}" BorderThickness="1" /> - </DockPanel> + <DockPanel VerticalAlignment="Bottom" Grid.ColumnSpan="2" TextElement.FontSize="16"> + <TextBlock HorizontalAlignment="Center" Foreground="{StaticResource AccentColorBrush}" FontWeight="SemiBold" FontSize="16">Delta E Reference Point</TextBlock> + <UniformGrid Columns="3" Margin="20 0 70 0"> + <DockPanel> + <TextBlock FontWeight="SemiBold">L:</TextBlock> + <mahapps:NumericUpDown BorderBrush="{StaticResource BorderBrush}" MinWidth="120" HorizontalContentAlignment="Left" Value="{Binding MeasureL,UpdateSourceTrigger=PropertyChanged}" Minimum="0" Maximum="100" Margin="5 0 0 0" HasDecimals="True" HideUpDownButtons="True" Background="{StaticResource LightBackground}" FontSize="16" Foreground="{StaticResource Accent}" BorderThickness="1" /> + </DockPanel> - <DockPanel> - <TextBlock Margin="20 0 0 0" FontWeight="SemiBold">A:</TextBlock> - <mahapps:NumericUpDown BorderBrush="{StaticResource BorderBrush}" MinWidth="120" HorizontalContentAlignment="Left" Value="{Binding MeasureA,UpdateSourceTrigger=PropertyChanged}" Minimum="-127" Maximum="128" Margin="5 0 0 0" HasDecimals="True" HideUpDownButtons="True" Background="{StaticResource LightBackground}" FontSize="16" Foreground="{StaticResource Accent}" BorderThickness="1" /> - </DockPanel> + <DockPanel> + <TextBlock Margin="20 0 0 0" FontWeight="SemiBold">A:</TextBlock> + <mahapps:NumericUpDown BorderBrush="{StaticResource BorderBrush}" MinWidth="120" HorizontalContentAlignment="Left" Value="{Binding MeasureA,UpdateSourceTrigger=PropertyChanged}" Minimum="-127" Maximum="128" Margin="5 0 0 0" HasDecimals="True" HideUpDownButtons="True" Background="{StaticResource LightBackground}" FontSize="16" Foreground="{StaticResource Accent}" BorderThickness="1" /> + </DockPanel> - <DockPanel> - <TextBlock Margin="20 0 0 0" FontWeight="SemiBold">B:</TextBlock> - <mahapps:NumericUpDown BorderBrush="{StaticResource BorderBrush}" MinWidth="120" HorizontalContentAlignment="Left" Value="{Binding MeasureB,UpdateSourceTrigger=PropertyChanged}" Minimum="-127" Maximum="128" Margin="5 0 0 0" HasDecimals="True" HideUpDownButtons="True" Background="{StaticResource LightBackground}" FontSize="16" Foreground="{StaticResource Accent}" BorderThickness="1" /> - </DockPanel> - </UniformGrid> - </DockPanel> + <DockPanel> + <TextBlock Margin="20 0 0 0" FontWeight="SemiBold">B:</TextBlock> + <mahapps:NumericUpDown BorderBrush="{StaticResource BorderBrush}" MinWidth="120" HorizontalContentAlignment="Left" Value="{Binding MeasureB,UpdateSourceTrigger=PropertyChanged}" Minimum="-127" Maximum="128" Margin="5 0 0 0" HasDecimals="True" HideUpDownButtons="True" Background="{StaticResource LightBackground}" FontSize="16" Foreground="{StaticResource Accent}" BorderThickness="1" /> + </DockPanel> + </UniformGrid> + </DockPanel> + </Grid> </Grid> </Grid> - </Grid> - <Grid Grid.Row="1" Margin="0 40 0 0"> - <Grid> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="800"/> - <ColumnDefinition Width="200"/> - <ColumnDefinition Width="1*"/> - </Grid.ColumnDefinitions> - <DockPanel> - <DockPanel DockPanel.Dock="Top" LastChildFill="False"> - <TextBlock VerticalAlignment="Center" DockPanel.Dock="Left" Foreground="{StaticResource AccentColorBrush}" FontWeight="SemiBold" FontSize="16">Snapshots</TextBlock> - <Button Command="{Binding CreateSnapshotCommand}" Height="35" DockPanel.Dock="Right" Style="{StaticResource MaterialDesignFlatButton}" BorderBrush="{StaticResource Accent}" BorderThickness="1"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Kind="ChevronDoubleDown" VerticalAlignment="Center" /> - <TextBlock Margin="10 0 0 0">Create Snapshot</TextBlock> - </StackPanel> - </Button> - </DockPanel> - <sharedControls:DoubleClickDataGrid DoubleClickCommand="{Binding OpenCaptureItemCommand}" Style="{StaticResource {x:Type DataGrid}}" ItemsSource="{Binding CaptureItems}" GridLinesVisibility="None" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False" IsReadOnly="True" Margin="0 10 0 0" Background="{StaticResource LightBackground}" Grid.ColumnSpan="2" TextElement.Foreground="Gainsboro" BorderBrush="{StaticResource Accent}" BorderThickness="1"> - <DataGrid.RowStyle> - <Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}"> - <Setter Property="Foreground" Value="{StaticResource Foreground}"></Setter> - <Setter Property="BorderBrush" Value="#202020"></Setter> - <Setter Property="VerticalContentAlignment" Value="Center"></Setter> - <Setter Property="BorderThickness" Value="0 0 0 1"></Setter> - <Style.Triggers> - <Trigger Property="IsMouseOver" Value="True"> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="Foreground" Value="{StaticResource AccentColorBrush}" /> - <Setter Property="Cursor" Value="Hand"></Setter> - </Trigger> - <Trigger Property="IsSelected" Value="True"> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="Foreground" Value="{StaticResource AccentColorBrush}" /> - </Trigger> - <Trigger Property="IsFocused" Value="True"> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="Foreground" Value="{StaticResource AccentColorBrush}" /> - </Trigger> - </Style.Triggers> - </Style> - </DataGrid.RowStyle> - <DataGrid.CellStyle> - <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> - <Setter Property="BorderThickness" Value="0"/> - <Setter Property="FocusVisualStyle" Value="{x:Null}"/> - <Setter Property="Foreground" Value="{StaticResource Foreground}"></Setter> - <Setter Property="VerticalContentAlignment" Value="Center"></Setter> - <Style.Triggers> - <Trigger Property="IsSelected" Value="True"> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="Foreground" Value="{StaticResource AccentColorBrush}" /> - </Trigger> - </Style.Triggers> - </Style> - </DataGrid.CellStyle> - <DataGrid.ColumnHeaderStyle> - <Style TargetType="DataGridColumnHeader" BasedOn="{StaticResource {x:Type DataGridColumnHeader}}"> - <Setter Property="Foreground" Value="{StaticResource Foreground}"></Setter> - </Style> - </DataGrid.ColumnHeaderStyle> - <DataGrid.Columns> - <DataGridTemplateColumn Header="#" Width="50"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <Image Width="30" Height="30" Source="{Binding Image}" Stretch="Fill"></Image> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTextColumn Header="TIME" Binding="{Binding Time,StringFormat='HH:mm:ss.fff'}" /> - <DataGridTemplateColumn Header="REF" Width="80"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <Rectangle Width="60"> - <Rectangle.Fill> - <SolidColorBrush Color="{Binding RefColor}"></SolidColorBrush> - </Rectangle.Fill> - </Rectangle> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTemplateColumn Header="CAPTURED" Width="90"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <Rectangle Width="60"> - <Rectangle.Fill> - <SolidColorBrush Color="{Binding CapturedColor}"></SolidColorBrush> - </Rectangle.Fill> - </Rectangle> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <DataGridTemplateColumn Header="PROCESSED" Width="90"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <Rectangle Width="60"> - <Rectangle.Fill> - <SolidColorBrush Color="{Binding ProcessedColor}"></SolidColorBrush> - </Rectangle.Fill> - </Rectangle> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> + <Grid Grid.Row="1" Margin="0 40 0 0"> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="800"/> + <ColumnDefinition Width="200"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + <DockPanel> + <DockPanel DockPanel.Dock="Top" LastChildFill="False"> + <TextBlock VerticalAlignment="Center" DockPanel.Dock="Left" Foreground="{StaticResource AccentColorBrush}" FontWeight="SemiBold" FontSize="16">Snapshots</TextBlock> + <Button Command="{Binding CreateSnapshotCommand}" Height="35" DockPanel.Dock="Right" Style="{StaticResource MaterialDesignFlatButton}" BorderBrush="{StaticResource Accent}" BorderThickness="1"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="ChevronDoubleDown" VerticalAlignment="Center" /> + <TextBlock Margin="10 0 0 0">Create Snapshot</TextBlock> + </StackPanel> + </Button> + </DockPanel> + <sharedControls:DoubleClickDataGrid DoubleClickCommand="{Binding OpenCaptureItemCommand}" Style="{StaticResource {x:Type DataGrid}}" ItemsSource="{Binding CaptureItems}" GridLinesVisibility="None" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserSortColumns="False" IsReadOnly="True" Margin="0 10 0 0" Background="{StaticResource LightBackground}" Grid.ColumnSpan="2" TextElement.Foreground="Gainsboro" BorderBrush="{StaticResource Accent}" BorderThickness="1"> + <DataGrid.RowStyle> + <Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}"> + <Setter Property="Foreground" Value="{StaticResource Foreground}"></Setter> + <Setter Property="BorderBrush" Value="#202020"></Setter> + <Setter Property="VerticalContentAlignment" Value="Center"></Setter> + <Setter Property="BorderThickness" Value="0 0 0 1"></Setter> + <Style.Triggers> + <Trigger Property="IsMouseOver" Value="True"> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="Foreground" Value="{StaticResource AccentColorBrush}" /> + <Setter Property="Cursor" Value="Hand"></Setter> + </Trigger> + <Trigger Property="IsSelected" Value="True"> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="Foreground" Value="{StaticResource AccentColorBrush}" /> + </Trigger> + <Trigger Property="IsFocused" Value="True"> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="Foreground" Value="{StaticResource AccentColorBrush}" /> + </Trigger> + </Style.Triggers> + </Style> + </DataGrid.RowStyle> + <DataGrid.CellStyle> + <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> + <Setter Property="BorderThickness" Value="0"/> + <Setter Property="FocusVisualStyle" Value="{x:Null}"/> + <Setter Property="Foreground" Value="{StaticResource Foreground}"></Setter> + <Setter Property="VerticalContentAlignment" Value="Center"></Setter> + <Style.Triggers> + <Trigger Property="IsSelected" Value="True"> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="Foreground" Value="{StaticResource AccentColorBrush}" /> + </Trigger> + </Style.Triggers> + </Style> + </DataGrid.CellStyle> + <DataGrid.ColumnHeaderStyle> + <Style TargetType="DataGridColumnHeader" BasedOn="{StaticResource {x:Type DataGridColumnHeader}}"> + <Setter Property="Foreground" Value="{StaticResource Foreground}"></Setter> + </Style> + </DataGrid.ColumnHeaderStyle> + <DataGrid.Columns> + <DataGridTemplateColumn Header="#" Width="50"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Image Width="30" Height="30" Source="{Binding Image}" Stretch="Fill"></Image> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTextColumn Header="TIME" Binding="{Binding Time,StringFormat='HH:mm:ss.fff'}" /> + <DataGridTemplateColumn Header="REF" Width="80"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Rectangle Width="60"> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding RefColor}"></SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="CAPTURED" Width="90"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Rectangle Width="60"> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding CapturedColor}"></SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="PROCESSED" Width="90"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Rectangle Width="60"> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding ProcessedColor}"></SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> - <DataGridTextColumn Header="REF L" Width="70" Binding="{Binding RefL}" /> - <DataGridTextColumn Header="REF A" Width="70" Binding="{Binding RefA}" /> - <DataGridTextColumn Header="REF B" Width="70" Binding="{Binding RefB}" /> - <DataGridTextColumn Header="DELTA E" Binding="{Binding DeltaE}" /> - </DataGrid.Columns> - </sharedControls:DoubleClickDataGrid> - </DockPanel> + <DataGridTextColumn Header="REF L" Width="70" Binding="{Binding RefL}" /> + <DataGridTextColumn Header="REF A" Width="70" Binding="{Binding RefA}" /> + <DataGridTextColumn Header="REF B" Width="70" Binding="{Binding RefB}" /> + <DataGridTextColumn Header="DELTA E" Binding="{Binding DeltaE}" /> + </DataGrid.Columns> + </sharedControls:DoubleClickDataGrid> + </DockPanel> - <DockPanel Grid.Column="2" Margin="0 0 60 0"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" DockPanel.Dock="Top"> - <TextBlock Foreground="{StaticResource AccentColorBrush}" FontWeight="SemiBold" FontSize="16">Delta E Distance</TextBlock> - <TextBlock VerticalAlignment="Center" Margin="5 0 0 0"> + <DockPanel Grid.Column="2" Margin="0 0 60 0"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" DockPanel.Dock="Top"> + <TextBlock Foreground="{StaticResource AccentColorBrush}" FontWeight="SemiBold" FontSize="16">Delta E Distance</TextBlock> + <TextBlock VerticalAlignment="Center" Margin="5 0 0 0"> <Run>(</Run> <Run Text="{Binding Config.DeltaEComparison}"></Run> <Run>)</Run> - </TextBlock> - </StackPanel> - <Grid> - <Border Margin="0 10 0 0" Padding="0 0 15 0" BorderThickness="1" BorderBrush="#202020"> - <Grid> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="55"/> - <ColumnDefinition Width="438*"/> - </Grid.ColumnDefinitions> + </TextBlock> + </StackPanel> + <Grid> + <Border Margin="0 10 0 0" Padding="0 0 15 0" BorderThickness="1" BorderBrush="#202020"> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="55"/> + <ColumnDefinition Width="438*"/> + </Grid.ColumnDefinitions> - <Border Margin="0 1 0 2"> - <realtimeGraphX:WpfGraphAxisControl Orientation="Vertical" Foreground="{StaticResource Accent}" FontSize="12" Controller="{Binding CaptureDeltaEController}" StringFormat="Δ 0.00;-#" /> - </Border> - <Border Grid.Column="1" BorderThickness="1" BorderBrush="{StaticResource Accent}" Margin="1 0 0 0" Background="{StaticResource LightBackground}"> - <Grid> + <Border Margin="0 1 0 2"> + <realtimeGraphX:WpfGraphAxisControl Orientation="Vertical" Foreground="{StaticResource Accent}" FontSize="12" Controller="{Binding CaptureDeltaEController}" StringFormat="Δ 0.00;-#" /> + </Border> + <Border Grid.Column="1" BorderThickness="1" BorderBrush="{StaticResource Accent}" Margin="1 0 0 0" Background="{StaticResource LightBackground}"> + <Grid> - <realtimeGraphX:WpfGraphGridLines Foreground="#3E3E3E" /> + <realtimeGraphX:WpfGraphGridLines Foreground="#3E3E3E" /> - <realtimeGraphX:WpfGraphSurface Controller="{Binding CaptureDeltaEController}"></realtimeGraphX:WpfGraphSurface> - </Grid> - </Border> - </Grid> - </Border> - </Grid> - </DockPanel> + <realtimeGraphX:WpfGraphSurface Controller="{Binding CaptureDeltaEController}"></realtimeGraphX:WpfGraphSurface> + </Grid> + </Border> + </Grid> + </Border> + </Grid> + </DockPanel> + </Grid> </Grid> </Grid> + + <UniformGrid VerticalAlignment="Top" HorizontalAlignment="Left" Width="200" Columns="2" Margin="300 -35 0 0"> + <Button Command="{Binding LiveCommand}" Height="35" Style="{StaticResource MaterialDesignFlatButton}" BorderThickness="0" Padding="5"> + <StackPanel Orientation="Horizontal"> + <StackPanel.Style> + <Style TargetType="StackPanel"> + <Setter Property="TextElement.Foreground" Value="{StaticResource Accent}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsEmulated}" Value="True"> + <Setter Property="TextElement.Foreground" Value="#808080"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </StackPanel.Style> + <materialDesign:PackIcon Kind="Camera" VerticalAlignment="Center" /> + <TextBlock Margin="5 0 0 0">Camera</TextBlock> + </StackPanel> + </Button> + <Button Command="{Binding EmulatedCommand}" Height="35" Style="{StaticResource MaterialDesignFlatButton}" BorderThickness="0" Padding="5"> + <StackPanel Orientation="Horizontal"> + <StackPanel.Style> + <Style TargetType="StackPanel"> + <Setter Property="TextElement.Foreground" Value="#808080"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsEmulated}" Value="True"> + <Setter Property="TextElement.Foreground" Value="{StaticResource Accent}"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </StackPanel.Style> + <materialDesign:PackIcon Kind="Image" VerticalAlignment="Center" /> + <TextBlock Margin="5 0 0 0">Emulated</TextBlock> + </StackPanel> + </Button> + </UniformGrid> </Grid> </TabItem> <TabItem Header="BENCHMARKS" Foreground="{StaticResource Foreground}"> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml index 82a57a22b..13d0e56d5 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml @@ -283,7 +283,7 @@ </Border> <Grid Background="{StaticResource TangoKeyboardBackground}"> - <controls:NavigationControl x:Name="NavigationControl" x:FieldModifier="public" TransitionAlwaysFades="False" TransitionType="Zoom" KeepElementsAttached="False"> + <controls:NavigationControl x:Name="NavigationControl" x:FieldModifier="public" TransitionAlwaysFades="False" TransitionType="Zoom" KeepElementsAttached="False" UseDefferedRendering="True"> <!--MODULES GOES HERE--> </controls:NavigationControl> </Grid> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml index 9899e60d4..005edb182 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml @@ -82,7 +82,7 @@ </Border> </touch:TouchPanel.TaskBarElement> - <controls:NavigationControl TransitionAlwaysFades="True" KeepElementsAttached="False" TransitionType="Zoom" x:Name="NavigationControl" x:FieldModifier="public"> + <controls:NavigationControl TransitionAlwaysFades="True" KeepElementsAttached="False" UseDefferedRendering="True" TransitionType="Zoom" x:Name="NavigationControl" x:FieldModifier="public"> <local:LoadingView></local:LoadingView> <local:LoadingErrorView></local:LoadingErrorView> <local:NoPermissionsView></local:NoPermissionsView> diff --git a/Software/Visual_Studio/TCC/Tango.TCC.BL/ColorDetector.cs b/Software/Visual_Studio/TCC/Tango.TCC.BL/ColorDetector.cs index d8a7f9dc7..5637512c6 100644 --- a/Software/Visual_Studio/TCC/Tango.TCC.BL/ColorDetector.cs +++ b/Software/Visual_Studio/TCC/Tango.TCC.BL/ColorDetector.cs @@ -114,7 +114,7 @@ namespace Tango.TCC.BL } else { - g.DrawRectangle(linePen, rect_width * columnIndex, rect_height * rowIndex, rect_width, rect_height); + //g.DrawRectangle(linePen, rect_width * columnIndex, rect_height * rowIndex, rect_width, rect_height); } if (drawProcessedColor && currentIndex == detectionInput.TargetIndex) diff --git a/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs b/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs index 1ec273e43..b3869daff 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Controls/NavigationControl.cs @@ -233,6 +233,16 @@ namespace Tango.SharedUI.Controls public static readonly DependencyProperty SelectedIndexProperty = DependencyProperty.Register("SelectedIndex", typeof(int), typeof(NavigationControl), new PropertyMetadata(0, (d, e) => (d as NavigationControl).OnSelectedIndexChanged())); + public bool UseDefferedRendering + { + get { return (bool)GetValue(UseDefferedRenderingProperty); } + set { SetValue(UseDefferedRenderingProperty, value); } + } + public static readonly DependencyProperty UseDefferedRenderingProperty = + DependencyProperty.Register("UseDefferedRendering", typeof(bool), typeof(NavigationControl), new PropertyMetadata(false)); + + + private void OnSelectedIndexChanged() { SelectedElement = Elements[SelectedIndex > Elements.Count - 1 ? 0 : SelectedIndex]; @@ -342,34 +352,47 @@ namespace Tango.SharedUI.Controls toRemove.ForEach(x => _grid.Children.Remove(x)); - foreach (var x in toAdd) + if (UseDefferedRendering) { - var navigationElement = new NavigationElement() + foreach (var x in toAdd) { - RenderTransformOrigin = new Point(0.5, 0.5), - Element = x, - Content = x, - }; - - _grid.Children.Add(navigationElement); + var navigationElement = new NavigationElement() + { + RenderTransformOrigin = new Point(0.5, 0.5), + Element = x, + Content = x, + }; - if (!KeepElementsAttached) - { - bool loaded = false; + _grid.Children.Add(navigationElement); - navigationElement.Loaded += (_, __) => + if (!KeepElementsAttached) { - if (!loaded) + bool loaded = false; + + navigationElement.Loaded += (_, __) => { - if (x != SelectedElement) + if (!loaded) { - loaded = true; - navigationElement.Content = null; + if (x != SelectedElement) + { + loaded = true; + navigationElement.Content = null; + } } - } - }; + }; + } } } + else + { + toAdd.ForEach(x => _grid.Children.Add( + new NavigationElement() + { + RenderTransformOrigin = new Point(0.5, 0.5), + Element = x, + Content = KeepElementsAttached ? x : null, + })); + } } if (!Elements.Contains(SelectedElement)) |
