Skip to content

Commit

Permalink
Dpi aware V2
Browse files Browse the repository at this point in the history
  • Loading branch information
mgth committed Aug 9, 2017
1 parent 232427c commit b793158
Show file tree
Hide file tree
Showing 68 changed files with 2,248 additions and 1,856 deletions.
Binary file added .vs/LittleBigMouse/v15/Solution.VC.db
Binary file not shown.
Binary file added .vs/LittleBigMouse/v15/Solution.VC.db-shm
Binary file not shown.
Empty file.
6 changes: 3 additions & 3 deletions Argyll/Argyll.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Argyll</RootNamespace>
<AssemblyName>Argyll</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand Down Expand Up @@ -75,9 +75,9 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\NotifyChange\NotifyChange\NotifyChange.csproj">
<ProjectReference Include="..\..\_ERP_\Erp\Notify\Erp.Notify.csproj">
<Project>{2ae41f7c-3c65-4d85-a184-3adffd40d8e2}</Project>
<Name>NotifyChange</Name>
<Name>Erp.Notify</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
36 changes: 17 additions & 19 deletions Argyll/ArgyllProbe.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
using System;
using Erp.Notify;
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Windows;
using System.Xml.Serialization;
using NotifyChange;

namespace Argyll
{
public class ArgyllProbe : Notifier
public class ArgyllProbe : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged
{
add => this.Add(value);
remove => this.Remove(value);
}
public ArgyllProbe()
{
ConfigFromDipcalGUI();
Expand Down Expand Up @@ -54,50 +60,42 @@ private static void ArgyllSendKey(Process p, String key)

public string Name
{
get { return GetProperty<string>(); }
set { SetProperty(value); }
get => this.Get<string>(); set => this.Set(value);
}

public double SpectrumFrom
{
get { return GetProperty<double>(); }
set { SetProperty(value); }
get => this.Get<double>(); set => this.Set(value);
}

public double SpectrumTo
{
get { return GetProperty<double>(); }
set { SetProperty(value); }
get => this.Get<double>(); set => this.Set(value);
}

public int SpectrumSteps
{
get { return GetProperty<int>(); }
set { SetProperty(value); }
get => this.Get<int>(); set => this.Set(value);
}

public double Cct
{
get { return GetProperty<double>(); }
set { SetProperty(value); }
get => this.Get<double>(); set => this.Set(value);
}

public double Cri
{
get { return GetProperty<double>(); }
set { SetProperty(value); }
get => this.Get<double>(); set => this.Set(value);
}

public double Tlci
{
get { return GetProperty<double>(); }
set { SetProperty(value); }
get => this.Get<double>(); set => this.Set(value);
}

public double Lux
{
get { return GetProperty<double>(); }
set { SetProperty(value); }
get => this.Get<double>(); set => this.Set(value);
}

public ObservableCollection<double> Spectrum { get; set; } = new ObservableCollection<double> {0};
Expand Down
3 changes: 1 addition & 2 deletions Argyll/ColorManagment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ public abstract class ProbedColor
{
public ProbedColor Illuminant
{
get { return _illuminant??this; }
set { _illuminant = value; }
get => _illuminant ?? this; set => _illuminant = value;
}

public abstract ProbedColorXYZ XYZ { get; }
Expand Down
3 changes: 1 addition & 2 deletions Argyll/Matrix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ public Matrix2D(int n)
//<indexeur>
public double this[int n, int p]
{
get { return _matrice[n, p]; }
set { _matrice[n, p] = value; }
get => _matrice[n, p]; set => _matrice[n, p] = value;
}
//</indexeur>

Expand Down
166 changes: 159 additions & 7 deletions LittleBigMouse.sln

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion LittleBigMouse_Control/App.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
Expand Down
13 changes: 8 additions & 5 deletions LittleBigMouse_Control/Curve.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Controls;
using NotifyChange;
using Erp.Notify;

namespace LittleBigMouse_Control
{
Expand All @@ -10,20 +10,23 @@ namespace LittleBigMouse_Control
/// </summary>
public partial class Curve : UserControl, INotifyPropertyChanged
{
protected readonly NotifierHelper Notify;
public event PropertyChangedEventHandler PropertyChanged
{
add => this.Add(value);
remove => this.Remove(value);
}

private IList<double> _points;
public event PropertyChangedEventHandler PropertyChanged { add { Notify.Add(value); } remove { Notify.Remove(value); } }
public Curve()
{
Notify = new NotifierHelper(this);
InitializeComponent();
DataContext = this;
}
// private PlotModel _plotModel = new PlotModel();
//public PlotModel PlotModel
//{
// get { return _plotModel; }
// set { Change.SetProperty(ref _plotModel, value); }
// set { Change.Set(ref _plotModel, value); }
//}

public void Refresh()
Expand Down
32 changes: 24 additions & 8 deletions LittleBigMouse_Control/LittleBigMon_Control.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LittleBigMouse_Control</RootNamespace>
<AssemblyName>LittleBigMouse_Control</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
Expand Down Expand Up @@ -81,9 +81,12 @@
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="LiveCharts, Version=0.6.4.0, Culture=neutral, PublicKeyToken=bc51a8d89213f1fa, processorArchitecture=MSIL">
<HintPath>..\packages\LiveCharts.0.6.4.0\lib\net46\LiveCharts.dll</HintPath>
<Private>True</Private>
<Reference Include="ErpSystem, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\LimsMonographies\ErpMessageBus\bin\Debug\ErpSystem.dll</HintPath>
</Reference>
<Reference Include="LiveCharts, Version=0.9.7.0, Culture=neutral, PublicKeyToken=0bc1f845d1ebb8df, processorArchitecture=MSIL">
<HintPath>..\packages\LiveCharts.0.9.7\lib\net45\LiveCharts.dll</HintPath>
</Reference>
<Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down Expand Up @@ -118,6 +121,11 @@
<Compile Include="Plugins\Debug\DebugViewModel.cs" />
<Compile Include="Plugins\Vcp\VcpScreenViewModel.cs" />
<Compile Include="PresenterViewModel.cs" />
<Compile Include="Rulers\RulerViewModel.cs" />
<Compile Include="Rulers\Tester.xaml.cs">
<DependentUpon>Tester.xaml</DependentUpon>
</Compile>
<Compile Include="Rulers\TesterViewModel.cs" />
<Compile Include="ScreenControlViewModel.cs" />
<Compile Include="Plugins\Size\SizeScreenView.xaml.cs">
<DependentUpon>SizeScreenView.xaml</DependentUpon>
Expand All @@ -139,7 +147,7 @@
<Compile Include="ScreenFrameView.xaml.cs">
<DependentUpon>ScreenFrameView.xaml</DependentUpon>
</Compile>
<Compile Include="Ruler.xaml.cs">
<Compile Include="Rulers\Ruler.xaml.cs">
<DependentUpon>Ruler.xaml</DependentUpon>
</Compile>
<Compile Include="ScreenFrameViewModel.cs" />
Expand Down Expand Up @@ -206,11 +214,15 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Rulers\Tester.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ScreenFrameView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Ruler.xaml">
<Page Include="Rulers\Ruler.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
Expand Down Expand Up @@ -286,9 +298,13 @@
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\NotifyChange\NotifyChange\NotifyChange.csproj">
<ProjectReference Include="..\..\_ERP_\Erp\Base\Erp.Base.csproj">
<Project>{edc4fe17-edae-42b1-80e4-fb5273f43d11}</Project>
<Name>Erp.Base</Name>
</ProjectReference>
<ProjectReference Include="..\..\_ERP_\Erp\Notify\Erp.Notify.csproj">
<Project>{2ae41f7c-3c65-4d85-a184-3adffd40d8e2}</Project>
<Name>NotifyChange</Name>
<Name>Erp.Notify</Name>
</ProjectReference>
<ProjectReference Include="..\Argyll\Argyll.csproj">
<Project>{444f1148-7014-469b-8809-834feda0f730}</Project>
Expand Down
37 changes: 15 additions & 22 deletions LittleBigMouse_Control/MainView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,7 @@ public partial class MainView

public MainView()
{
try
{
InitializeComponent();
}
catch (System.Windows.Markup.XamlParseException)
{

}
InitializeComponent();
_resizer = new WindowResizer(this,ResizeGrid);


Expand Down Expand Up @@ -96,7 +89,7 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
// return;

// Screen old = _locationScreen;
// if (!_change.SetProperty(ref _locationScreen, value)) return;
// if (!_change.Set(ref _locationScreen, value)) return;

// if (old!=null) old.PropertyChanged -= LocationScreenOnPropertyChanged;
// _locationScreen.PropertyChanged += LocationScreenOnPropertyChanged;
Expand All @@ -117,8 +110,8 @@ private void Window_Loaded(object sender, RoutedEventArgs e)

//public void SaveLocation()
//{
// Point topLeft = LocationScreen.AbsoluteWorkingArea.TopLeft.Wpf.Point; ;
// Point bottomRight = LocationScreen.AbsoluteWorkingArea.BottomRight.Wpf.Point;
// Point topLeft = LocationScreen.AbsoluteWorkingArea.TopLeft.Dip.Point; ;
// Point bottomRight = LocationScreen.AbsoluteWorkingArea.BottomRight.Dip.Point;

// LocationScreen.GuiLocation =
// new Rect(
Expand All @@ -141,11 +134,11 @@ private void Window_Loaded(object sender, RoutedEventArgs e)

// LocationScreen = s;

// //Point topLeft = LocationScreen.Bounds.TopLeft.Wpf.Point;
// //Point bottomRight = LocationScreen.Bounds.BottomRight.Wpf.Point;
// //Point topLeft = LocationScreen.Bounds.TopLeft.Dip.Point;
// //Point bottomRight = LocationScreen.Bounds.BottomRight.Dip.Point;

// Point topLeft = LocationScreen.AbsoluteWorkingArea.TopLeft.Wpf.Point;//Bounds.TopLeft.Wpf.Point;
// Point bottomRight = LocationScreen.AbsoluteWorkingArea.BottomRight.Wpf.Point;//Bounds.BottomRight.Wpf.Point;
// Point topLeft = LocationScreen.AbsoluteWorkingArea.TopLeft.Dip.Point;//Bounds.TopLeft.Dip.Point;
// Point bottomRight = LocationScreen.AbsoluteWorkingArea.BottomRight.Dip.Point;//Bounds.BottomRight.Dip.Point;

// Top = topLeft.Y + (bottomRight.Y - topLeft.Y) * LocationScreen.GuiLocation.Top;
// Left = topLeft.X + (bottomRight.X - topLeft.X) * LocationScreen.GuiLocation.Left;
Expand Down Expand Up @@ -176,31 +169,31 @@ public void OnMouseDown(object sender, MouseButtonEventArgs e)



//[DependsOn("Location")]
//[TriggedOn("Location")]
//public Screen DrawnOnScreen
//{
// get
// {
// var p1 = new WpfPoint(Config, Config.Selected, Left, Top);
// var p1 = new DipPoint(Config, Config.Selected, Left, Top);
// return p1.TargetScreen;
// }
//}

//[DependsOn("DrawnOnScreen","State", "ShowRulers")]
//[TriggedOn("DrawnOnScreen","State", "ShowRulers")]
//public GridLength HorizontalResizerSize
// => WindowState == WindowState.Maximized /*&& ShowRulers*/ ?
// new GridLength(30 * LocationScreen.PhysicalToWpfRatioX / ScaleFactor) : new GridLength(10);
// new GridLength(30 * LocationScreen.MmToDipRatioX / ScaleFactor) : new GridLength(10);

//[DependsOn("DrawnOnScreen", "State", "ShowRulers")]
//[TriggedOn("DrawnOnScreen", "State", "ShowRulers")]
//public GridLength VerticalResizerSize
// => WindowState == WindowState.Maximized /*&& ShowRulers*/ ?
// new GridLength(30 * LocationScreen.PhysicalToWpfRatioY / ScaleFactor) : new GridLength(10);
// new GridLength(30 * LocationScreen.MmToDipRatioY / ScaleFactor) : new GridLength(10);

//private void ConfigGui_OnLocationChanged(object sender, EventArgs e)
//{
// if (_doNotSaveLocation) return;

// AbsolutePoint p = new WpfPoint(Config,null,Left + Width/2,Top + Height/2);
// AbsolutePoint p = new DipPoint(Config,null,Left + Width/2,Top + Height/2);
// if (p.TargetScreen != LocationScreen)
// {
// double width = Width / LocationScreen.WpfToPixelRatioX;
Expand Down
12 changes: 5 additions & 7 deletions LittleBigMouse_Control/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Windows.Controls.Primitives;
using System.Windows.Data;
using System.Windows.Input;
using Erp.Notify;
using LbmScreenConfig;
using LittleBigMouse_Control.Plugins;

Expand Down Expand Up @@ -38,23 +39,20 @@ private void Plugins_CollectionChanged(object sender, System.Collections.Special

public ScreenConfig Config
{
get { return GetProperty<ScreenConfig>(); }
set { SetProperty(value); }
get => this.Get<ScreenConfig>(); set => this.Set(value);
}


public ViewModel Control
{
get { return GetProperty<ViewModel>(); }
set { SetProperty(value);}
get => this.Get<ViewModel>(); set => this.Set(value);
}

public PresenterViewModel Presenter
{
get { return GetProperty<PresenterViewModel>(); }
set
get => this.Get<PresenterViewModel>(); set
{
if (SetAndWatch(value))
if (this.Set(value))
{
Presenter.MainViewModel = this;
}
Expand Down
Loading

0 comments on commit b793158

Please sign in to comment.