Skip to content

Greenhouse model#42

Open
elizakuz wants to merge 30 commits intoyurii-litvinov:masterfrom
elizakuz:master
Open

Greenhouse model#42
elizakuz wants to merge 30 commits intoyurii-litvinov:masterfrom
elizakuz:master

Conversation

@elizakuz
Copy link
Collaborator

No description provided.

open Repo
open Repo.DataLayer
open Repo.InfrastructureSemanticLayer
open System.Security.Policy
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это правда нужно? :)

@@ -0,0 +1,93 @@
namespace Repo.Metametamodels
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо ещё шапку с лицензией, здесь и ниже

this.Graph = new Graph(model);
this.Graph.DrawGraph += (sender, args) => this.DrawGraph();
this.Graph.RelayoutGraph += (sender, args) => this.scene.RelayoutGraph(true);
this.Graph.ZoomToFeel += (sender, args) => this.zoomControl.ZoomToFill();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ZoomToFill?

foreach (var x in vertex.Value.VertexConnectionPointsList)
{
var aVCPforGH = x as StaticVertexConnectionPointForGH;
if (aVCPforGH != null && aVCPforGH.IsOccupied == false && aVCPforGH.IsSource == false)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше !aVCPforGH.IsOccupied

else
{
// if the model is initially incorrect
if (vertex.Key.Node.Name == "aInterval")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Что за хардкод в редакторе? :)


private void AddNewEdgeControl(EdgeViewModel edgeViewModel)
{
if (this.model.ModelName == "GreenhouseTestModel")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А как это обобщить, чтобы не хардкодить в редакторе имя конкретной модели?

}
else
{
if (ctrlVerVertex.Node.Name == "aInterval")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И не хардкодить в редакторе имя конкретного узла?

{
using GraphX.Controls;

public class StaticVertexConnectionPointForGH : StaticVertexConnectionPoint
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо ещё коментарий

{
get;
set;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это обычно в одну строчку пишется

}
}

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мне кажется, это лишнее :)

appveyor.yml Outdated

before_build:
- .paket\paket.exe update
- .paket\paket.exe install
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мне кажется, этого в билд-скрипте лучше не делать, иначе билд будет ломаться каждый раз, когда кто-нибудь решит обновить один из пакетов, от которых мы зависим, на NuGet-е. Лучше фиксировать версии пакетов в paket.lock, использовать в CI его, и обновлять пакеты вручную и проверяя, что ничего не отвалилось.

@@ -0,0 +1,47 @@
/* Copyright 2017-2018 REAL.NET group
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну если бы в REAL.NET предполагался один-единственный генератор, то такое название проекта было бы оправданно. Но это уже не так, а дальше будет только ещё более не так :)

if (value > 0)
{
Console.WriteLine("----- Actuator {0} TRUE!!! -----", Num);
this.Event(this, 1);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ой. this.Event?.Invoke(this, 1). Иначе упадёт, если на нас никто пока не подписался.

/// </summary>
public class Actuator
{
public int Num { get; }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я бы сказал, что нужен комментарий. И я бы сказал это не из объектно-ориентированного чистоплюйства, а потому что я реально без идей, что делает эта штука :)

{
if (value > 0)
{
Console.WriteLine("----- Actuator {0} TRUE!!! -----", Num);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Console.WriteLine("----- Actuator {0} TRUE!!! -----", Num);
Console.WriteLine($"----- Actuator {Num} TRUE!!! -----");

/// <summary>
/// Helps to represent sensors from model in repo.
/// </summary>

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пустая строка между комментарием и классом обычно не ставится

aLink.Target <- Some dst
dst

airTemperature --> interval1 --> openWindow |> ignore*)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мм? Можно две тестовые модели сделать :)

public class SensorSim
{
private Timer timer;
private Random rnd = new Random(unchecked((int)(DateTime.Now.Ticks)));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Просто new Random() делает то же самое.

/*var fileName = (model == null || model.CurrentFileName == "")
? "(unsaved)"
: model.CurrentFileName;
var unsavedChanges = model?.HasUnsavedChanges == true ? "*" : "";*/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Хаос :)

private void AddNewVertexControl(NodeViewModel vertex)
{
var vc = new VertexControl(vertex);
if (this.model.ModelName == "GreenhouseTestModel")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А как это по-нормальному сделать?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants