Skip to content

Commit

Permalink
Merge pull request #97 from lacmus-foundation/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
gosha20777 authored May 5, 2020
2 parents f02d892 + d48dc7e commit 3eb040c
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/LacmusApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<PackageReference Include="Avalonia.Native" Version="0.9.9" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.9.9" />
<PackageReference Include="Avalonia.Skia.Linux.Natives" Version="1.68.0.2" />
<PackageReference Include="Citrus.Avalonia" Version="1.2.5" />
<PackageReference Include="Citrus.Avalonia" Version="1.2.4" />
<PackageReference Include="CUDAfy.NET" Version="1.29.5576.13786" />
<PackageReference Include="Docker.DotNet" Version="3.125.2" />
<PackageReference Include="Material.Avalonia" Version="0.9.0" />
Expand Down
2 changes: 1 addition & 1 deletion src/Models/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public async Task Save(string path)

public async Task Save()
{
var confDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
var confDir = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "lacmus");
var configPath = Path.Join(confDir,"appConfig.json");
await Save(configPath);
}
Expand Down
4 changes: 3 additions & 1 deletion src/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using Avalonia;
using Avalonia.Logging.Serilog;
Expand All @@ -21,10 +22,11 @@ private static void Main(string[] args)
Console.WriteLine("This is free software, and you are welcome to redistribute it under GNU GPL license;\nClick `help` -> `about' for details.");
Console.WriteLine("------------------------------------");

var logPath = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "lacmus", "log.log");
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Console()
.WriteTo.File("log.txt",
.WriteTo.File(logPath,
rollingInterval: RollingInterval.Day,
rollOnFileSizeLimit: true)
.CreateLogger();
Expand Down
3 changes: 3 additions & 0 deletions src/ViewModels/FourthWizardViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ public async Task PredictAll()
{
Status = "starting ml model...";
//load config
var confDir = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "lacmus");
var configPath = Path.Join(confDir,"appConfig.json");
_appConfig = await AppConfig.Create(configPath);
var config = _appConfig.MlModelConfig;
using (var model = new MLModel(config))
{
Expand Down
4 changes: 2 additions & 2 deletions src/ViewModels/ThirdWizardViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public async void UpdateModelStatus()
{
Log.Information("Loading ml model.");
Status = "Loading ml model...";
var confDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
var configPath = Path.Join(confDir, "lacmus", "appConfig.json");
var confDir = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "lacmus");
var configPath = Path.Join(confDir,"appConfig.json");
_appConfig = await AppConfig.Create(configPath);
var config = _appConfig.MlModelConfig;;
// get local versions
Expand Down
9 changes: 4 additions & 5 deletions src/Views/ModelManagerWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:cp="clr-namespace:ThemeEditor.Controls.ColorPicker;assembly=ThemeEditor.Controls.ColorPicker"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="LacmusApp.Views.ModelManagerWindow"
SizeToContent="WidthAndHeight"
x:Class="LacmusApp.Views.ModelManagerWindow"
Icon="resm:LacmusApp.Assets.avalonia-logo.ico"
CanResize="True"
Width = "400"
Height = "350" Title="Models Manager">
Width = "550"
Height = "450"
Title="Models Manager">

<Window.Styles>
<Style Selector="DataGrid">
Expand Down
7 changes: 3 additions & 4 deletions src/Views/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:cp="clr-namespace:ThemeEditor.Controls.ColorPicker;assembly=ThemeEditor.Controls.ColorPicker"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="LacmusApp.Views.SettingsWindow"
SizeToContent="WidthAndHeight"
x:Class="LacmusApp.Views.SettingsWindow"
Icon="resm:LacmusApp.Assets.avalonia-logo.ico"
CanResize="True"
Width = "400"
Height = "350" Title="{Binding LocalizationContext.Settings}">
Width = "550"
Height = "400" Title="{Binding LocalizationContext.Settings}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
Expand Down

0 comments on commit 3eb040c

Please sign in to comment.