Студопедия
Случайная страница | ТОМ-1 | ТОМ-2 | ТОМ-3
АвтомобилиАстрономияБиологияГеографияДом и садДругие языкиДругоеИнформатика
ИсторияКультураЛитератураЛогикаМатематикаМедицинаМеталлургияМеханика
ОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРелигияРиторика
СоциологияСпортСтроительствоТехнологияТуризмФизикаФилософияФинансы
ХимияЧерчениеЭкологияЭкономикаЭлектроника

Приложение Б. Программа экспертной системы в среде КАРРА 2.4

Читайте также:
  1. Host BusПредназначена для скоростной передачи данных (64 разряда) и сигналов управления между процессором и остальными компонентами системы.
  2. I этап реформы банковской системы (подготовительный)приходится на 1988–1990 гг.
  3. I. Методы исследования в акушерстве. Организация системы акушерской и перинатальной помощи.
  4. I. РАСТВОРЫ И ДИСПЕРСНЫЕ СИСТЕМЫ
  5. I. Характеристика проблемы, на решение которой направлена подпрограмма
  6. I. Характеристика проблемы, на решение которой направлена Программа
  7. I. Характеристика проблемы, на решение которой направлена Программа

/** Создание функций **/

/** FUNCTION: Fend **/

MakeFunction(Fend, [],

{

HideWindow(SESSION);

});

/** FUNCTION: Main **/

MakeFunction(Main, [],

{

ShowWindow(SESSION);

ClearTranscriptImage(Transcript1);

ClearTranscriptImage(Transcript2);

ClearTranscriptImage(Transcript3);

ClearTranscriptImage(Transcript4);

ClearTranscriptImage(Transcript5);

ClearTranscriptImage(Transcript6);

ClearTranscriptImage(Transcript7);

ClearTranscriptImage(Transcript8);

ClearTranscriptImage(Transcript9);

ClearTranscriptImage(Transcript10);

ClearTranscriptImage(Transcript11);

ClearTranscriptImage(Transcript12);

Global:u = int;

Assert(Global, u);

ForwardChain(Stopp);

});

/** FUNCTION: Stop **/

MakeFunction(Stop, [],

{

ClearTranscriptImage(Transcript1);

ClearTranscriptImage(Transcript2);

ClearTranscriptImage(Transcript3);

ClearTranscriptImage(Transcript4);

ClearTranscriptImage(Transcript5);

ClearTranscriptImage(Transcript6);

ClearTranscriptImage(Transcript7);

ClearTranscriptImage(Transcript8);

ClearTranscriptImage(Transcript9);

ClearTranscriptImage(Transcript10);

ClearTranscriptImage(Transcript11);

ClearTranscriptImage(Transcript12);

ForwardChain(Stopp);

Global:u = end;

});

/** FUNCTION: ShowSession1 **/

MakeFunction(ShowSession1, [],

{

ShowWindow(Session1);

});

/** FUNCTION: ShowSESSION **/

MakeFunction(ShowSESSION, [],

{

ShowWindow(SESSION);

HideWindow(Session1);

HideWindow(Session3);

});

/** FUNCTION: ReadBD **/

MakeFunction(ReadBD, [],

{

SetNthElem(BD:Name, BD:Nr, BD:NamePar);

SetNthElem(BD:Max, BD:Nr, BD:MaxPr);

SetNthElem(BD:Min, BD:Nr, BD:MinPr);

SetNthElem(BD:Eiz, BD:Nr, BD:Eizm);

});

/** FUNCTION: OpenBD **/

MakeFunction(OpenBD, [],

{

BD:NamePar = GetNthElem(BD:Name, BD:Nr);

BD:Eizm = GetNthElem(BD:Eiz, BD:Nr);

BD:MaxPr = GetNthElem(BD:Max, BD:Nr);

BD:MinPr = GetNthElem(BD:Min, BD:Nr);

});

/** FUNCTION: ShowSession3 **/

MakeFunction(ShowSession3, [],

{

ShowWindow(Session3);

});

/** FUNCTION: ValueBD **/

MakeFunction(ValueBD, [],

TRUE);

 

/** создание классов **/

MakeClass(s1, Root);

MakeSlot(s1:text);

s1:text = "Вымывание ила в отстойник";

MakeSlot(s1:Sts1);

SetSlotOption(s1:Sts1, VALUE_TYPE, BOOLEAN);

s1:Sts1 = 0;

 

/** CLASS: Pr11 **/

MakeClass(Pr11, s1);

MakeSlot(Pr11:textPr);

Pr11:textPr = "Повышенная гидравлическая нагрузка";

MakeSlot(Pr11:textRec);

Pr11:textRec = "Увеличить подачу воздуха в аэраторы, увеличить периодичность откачки";

MakeSlot(Pr11:StPr11);

SetSlotOption(Pr11:StPr11, VALUE_TYPE, BOOLEAN);

Pr11:StPr11 = 0;

MakeSlot(Pr11:Kr11);

SetSlotOption(Pr11:Kr11, VALUE_TYPE, NUMBER);

Pr11:Kr11 = 1;

 

/** CLASS: Pr12 **/

MakeClass(Pr12, s1);

MakeSlot(Pr12:textPr);

Pr12:textPr = FormatValue ("\"вспухание\" ила, наличие недопустимых загрязнителей");

MakeSlot(Pr12:StPr12);

Pr12:StPr12 = 0;

MakeSlot(Pr12:textRec);

Pr12:textRec = "Уменьшить расход рецикла и подачу воздуха в аэраторы";

MakeSlot(Pr12:Kr12);

SetSlotOption(Pr12:Kr12, VALUE_TYPE, NUMBER);

Pr12:Kr12 = 1;

/** CLASS: BD **/

MakeClass(BD, Root);

MakeSlot(BD:Nr);

SetSlotOption(BD:Nr, ALLOWABLE_VALUES, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);

BD:Nr = 5;

SetSlotOption(BD:Nr, IMAGE, ComboBox1);

MakeSlot(BD:Max);

SetSlotOption(BD:Max, MULTIPLE);

SetSlotOption(BD:Max, VALUE_TYPE, NUMBER);

SetValue(BD:Max,350,17,6,790,.5, 4,4,40,40,40,40,40, 40, 40,100, 140, 140,0,0,0,0,0,0,0,0,0,0);

MakeSlot(BD:Min);

SetSlotOption(BD:Min, MULTIPLE);

SetSlotOption(BD:Min, VALUE_TYPE, NUMBER);

SetValue(BD:Min, 150, 5, 4, 350, 0.5, 2.5, 2.5, 20, 20, 20, 20, 20, 20, 20, 30, 130, 130, 130, 0);

MakeSlot(BD:Name);

SetSlotOption(BD:Name, MULTIPLE);

SetValue(BD:Name, "БПК на входе", "БПК на выходе", "Концентрация растверённого кислорода/зона1", "Расход поступающей воды", "Уровень ила во вторичном отстойнике", "Концентрация растворённого кислорода/зона2", "Концентрация растворённого кислорода/зона3", "Давление в аэраторе№1", "Давление в аэраторе№2", "Давление в аэраторе№3", "Давление в аэраторе№4", "Давление в аэраторе№5", "Давление в аэраторе№6", "Давление в аэраторе№7", "Давление от компрессора", ила, в, отстойнике, "

", Концентраци, растворённого, кислорода, /, зона2, "

", Концентраци, растворённого, кислорода, /, зона3, "

", Давление, в, аэраторе№1, "

", Давление, в, аэраторе№2, "

", Давление, в, аэраторе№3, "

", Давление, в, аэраторе№4, "

", Давление, в, аэраторе№6, "

);

SetSlotOption(BD:Name, IMAGE, Edit6);

MakeSlot(BD:MaxPr);

SetSlotOption(BD:MaxPr, VALUE_TYPE, NUMBER);

BD:MaxPr = 3.5;

SetSlotOption(BD:MaxPr, IMAGE, Edit39);

MakeSlot(BD:MinPr);

SetSlotOption(BD:MinPr, VALUE_TYPE, NUMBER);

BD:MinPr = 0.5;

SetSlotOption(BD:MinPr, IMAGE, Edit38);

MakeSlot(BD:Eizm);

BD:Eizm = м;

SetSlotOption(BD:Eizm, IMAGE, Edit40);

MakeSlot(BD:NamePar);

BD:NamePar = "Уровень ила во вторичном отстойнике";

SetSlotOption(BD:NamePar, IMAGE, Edit6);

MakeSlot(BD:Eiz);

SetSlotOption(BD:Eiz, MULTIPLE);

SetValue(BD:Eiz, "гО2/м3", "гО2/м3", "г/м3", "м3/ч", м, "г/м3", "г/м3", кПа, кПа, кПа, кПа, кПа, кПа, кПа, кПа);

 

/** CLASS: s2 **/

MakeClass(s2, Root);

MakeSlot(s2:text);

s2:text = "Продувка аэраторов";

MakeSlot(s2:Sts2);

SetSlotOption(s2:Sts2, VALUE_TYPE, BOOLEAN);

s2:Sts2 = 0;

 

/** CLASS: s3 **/

MakeClass(s3, Root);

MakeSlot(s3:text);

s3:text = "Засорение аэратора";

MakeSlot(s3:Sts3);

SetSlotOption(s3:Sts3, VALUE_TYPE, BOOLEAN);

s3:Sts3 = 0;

 

/** CLASS: Pr31 **/

MakeClass(Pr31, s3);

MakeSlot(Pr31:textPr);

Pr31:textPr = "засорение аэратора№1 минерализатора";

MakeSlot(Pr31:textRec);

Pr31:textRec = "Включить продувку аэраторов";

MakeSlot(Pr31:StPr31);

SetSlotOption(Pr31:StPr31, VALUE_TYPE, BOOLEAN);

Pr31:StPr31 = 0;

MakeSlot(Pr31:Kr31);

SetSlotOption(Pr31:Kr31, VALUE_TYPE, NUMBER);

Pr31:Kr31 = 0.2412;

 

/** CLASS: Pr32 **/

MakeClass(Pr32, s3);

MakeSlot(Pr32:textPr);

Pr32:textPr = "засорение аэратора№2 минерализатора";

MakeSlot(Pr32:textRec);

Pr32:textRec = "Включить продувку аэраторов";

MakeSlot(Pr32:StPr32);

SetSlotOption(Pr32:StPr32, VALUE_TYPE, BOOLEAN);

Pr32:StPr32 = 0;

MakeSlot(Pr32:Kr32);

SetSlotOption(Pr32:Kr32, VALUE_TYPE, NUMBER);

Pr32:Kr32 = 0.276;

 

/** CLASS: Pr33 **/

MakeClass(Pr33, s3);

MakeSlot(Pr33:textPr);

Pr33:textPr = "засорение аэратора№1 нитрификатора";

MakeSlot(Pr33:textRec);

Pr33:textRec = "Включить продувку аэраторов";

MakeSlot(Pr33:StPr33);

SetSlotOption(Pr33:StPr33, VALUE_TYPE, BOOLEAN);

Pr33:StPr33 = 0;

MakeSlot(Pr33:Kr33);

SetSlotOption(Pr33:Kr33, VALUE_TYPE, NUMBER);

Pr33:Kr33 = 1;

 

/** CLASS: Pr34 **/

MakeClass(Pr34, s3);

MakeSlot(Pr34:textPr);

Pr34:textPr = "засорение аэратора№2 нитрификатора";

MakeSlot(Pr34:textRec);

Pr34:textRec = "Включить продувку аэраторов";

MakeSlot(Pr34:StPr34);

SetSlotOption(Pr34:StPr34, VALUE_TYPE, BOOLEAN);

Pr34:StPr34 = 0;

MakeSlot(Pr34:Kr34);

SetSlotOption(Pr34:Kr34, VALUE_TYPE, NUMBER);

Pr34:Kr34 = 0.2068;

 

/** CLASS: Pr35 **/

MakeClass(Pr35, s3);

MakeSlot(Pr35:textPr);

Pr35:textPr = "засорение аэратора№3 нитрификатора";

MakeSlot(Pr35:textRec);

Pr35:textRec = "Включить продувку аэраторов";

MakeSlot(Pr35:StPr35);

SetSlotOption(Pr35:StPr35, VALUE_TYPE, BOOLEAN);

Pr35:StPr35 = 0;

MakeSlot(Pr35:Kr35);

SetSlotOption(Pr35:Kr35, VALUE_TYPE, NUMBER);

Pr35:Kr35 = 0.6896;

 

/** CLASS: Pr36 **/

MakeClass(Pr36, s3);

MakeSlot(Pr36:textPr);

Pr36:textPr = "засорение аэратора№1 блока доочистки";

MakeSlot(Pr36:textRec);

Pr36:textRec = "Включить продувку аэраторов";

MakeSlot(Pr36:StPr36);

SetSlotOption(Pr36:StPr36, VALUE_TYPE, BOOLEAN);

Pr36:StPr36 = 0;

MakeSlot(Pr36:Kr36);

SetSlotOption(Pr36:Kr36, VALUE_TYPE, NUMBER);

Pr36:Kr36 = 0.5516;

 

/** CLASS: Pr37 **/

MakeClass(Pr37, s3);

MakeSlot(Pr37:textPr);

Pr37:textPr = "засорение аэратора№2 блока доочистки";

MakeSlot(Pr37:textRec);

Pr37:textRec = "Включить продувку аэраторов";

MakeSlot(Pr37:StPr37);

SetSlotOption(Pr37:StPr37, VALUE_TYPE, BOOLEAN);

Pr37:StPr37 = 0;

MakeSlot(Pr37:Kr37);

SetSlotOption(Pr37:Kr37, VALUE_TYPE, NUMBER);

Pr37:Kr37 = 0.724;

 

/** CLASS: s4 **/

MakeClass(s4, Root);

MakeSlot(s4:text);

s4:text = "Возможен дефицит биогенных элементов";

MakeSlot(s4:Sts4);

SetSlotOption(s4:Sts4, VALUE_TYPE, BOOLEAN);

s4:Sts4 = 0;

 

/** CLASS: Pr41 **/

MakeClass(Pr41, s4);

MakeSlot(Pr41:textPr);

Pr41:textPr = "недостаточное питание";

MakeSlot(Pr41:textRec);

Pr41:textRec = "Увеличить расход рецикла";

MakeSlot(Pr41:StPr41);

SetSlotOption(Pr41:StPr41, VALUE_TYPE, BOOLEAN);

Pr41:StPr41 = 0;

MakeSlot(Pr41:Kr41);

SetSlotOption(Pr41:Kr41, VALUE_TYPE, NUMBER);

Pr41:Kr41 = 0.638152680652681;

 

/** CLASS: s5 **/

MakeClass(s5, Root);

MakeSlot(s5:text);

s5:text = "Возможен недостаток кислорода";

MakeSlot(s5:Sts5);

SetSlotOption(s5:Sts5, VALUE_TYPE, BOOLEAN);

s5:Sts5 = 0;

 

/** CLASS: Pr51 **/

MakeClass(Pr51, s5);

MakeSlot(Pr51:textPr);

Pr51:textPr = "недостаточная аэрация в минерализаторе";

MakeSlot(Pr51:textRec);

Pr51:textRec = "Увеличить подачу воздуха в минерализатор";

MakeSlot(Pr51:StPr51);

SetSlotOption(Pr51:StPr51, VALUE_TYPE, BOOLEAN);

Pr51:StPr51 = 0;

MakeSlot(Pr51:Kr51);

SetSlotOption(Pr51:Kr51, VALUE_TYPE, NUMBER);

Pr51:Kr51 = 0.947818181818182;

 

/** CLASS: Pr52 **/

MakeClass(Pr52, s5);

MakeSlot(Pr52:textPr);

Pr52:textPr = "недостаточная аэрация в нитрификаторе";

MakeSlot(Pr52:textRec);

Pr52:textRec = "Увеличить аэрацию нитрификатора";

MakeSlot(Pr52:StPr52);

SetSlotOption(Pr52:StPr52, VALUE_TYPE, BOOLEAN);

Pr52:StPr52 = 0;

MakeSlot(Pr52:Kr52);

SetSlotOption(Pr52:Kr52, VALUE_TYPE, NUMBER);

Pr52:Kr52 = 0.881151515151515;

 

/** CLASS: Pr53 **/

MakeClass(Pr53, s5);

MakeSlot(Pr53:textPr);

Pr53:textPr = "недостаточная аэрация блока доочистки";

MakeSlot(Pr53:textRec);

Pr53:textRec = "Увеличить подачу воздуха в блок доочистки";

MakeSlot(Pr53:StPr53);

SetSlotOption(Pr53:StPr53, VALUE_TYPE, BOOLEAN);

Pr53:StPr53 = 0;

MakeSlot(Pr53:Kr53);

SetSlotOption(Pr53:Kr53, VALUE_TYPE, NUMBER);

Pr53:Kr53 = 0.881151515151515;

 

/** CLASS: s6 **/

MakeClass(s6, Root);

MakeSlot(s6:text);

s6:text = "Процесс идёт нормально";

MakeSlot(s6:Sts6);

SetSlotOption(s6:Sts6, VALUE_TYPE, BOOLEAN);

s6:Sts6 = 1;

 

/** создание объектов **/

MakeSlot(Global:u);

Global:u = end;

MakeSlot(Global:C1);

SetSlotOption(Global:C1, VALUE_TYPE, NUMBER);

Global:C1 = 0.446153846153846;

MakeSlot(Global:C2);

SetSlotOption(Global:C2, VALUE_TYPE, NUMBER);

Global:C2 = 0.830151515151515;

MakeSlot(Global:Null);

Global:Null = -;

MakeSlot(Global:C3);

SetSlotOption(Global:C3, VALUE_TYPE, NUMBER);

Global:C3 = 0.725757575757576;

MakeSlot(Global:C4);

SetSlotOption(Global:C4, VALUE_TYPE, NUMBER);

Global:C4 = 1;

 

/** INSTANCE: SESSION **/

SESSION:X = 133;

SESSION:Y = 88;

SESSION:Title = SESSION;

SESSION:SessionNumber = 0;

SESSION:Width = 1084;

SESSION:Height = 512;

SESSION:Menu = TRUE;

SESSION:Visible = FALSE;

SESSION:State = HIDDEN;

ResetWindow(SESSION);

 

/** INSTANCE: Session1 **/

MakeInstance(Session1, KSession);

Session1:X = 174;

Session1:Y = 45;

Session1:Title = Session1;

Session1:SessionNumber = 1;

Session1:Width = 502;

Session1:Height = 884;

Session1:Visible = FALSE;

Session1:State = HIDDEN;

ResetWindow(Session1);

 

/** INSTANCE: Session3 **/

MakeInstance(Session3, KSession);

Session3:X = 332;

Session3:Y = 129;

Session3:Title = Session3;

Session3:SessionNumber = 3;

Session3:Width = 578;

Session3:Height = 396;

Session3:Visible = FALSE;

Session3:State = HIDDEN;

ResetWindow(Session3);

 

/** INSTANCE: Oper **/

MakeInstance(Oper, Root);

MakeSlot(Oper:BODin);

Oper:BODin = 244.016;

SetSlotOption(Oper:BODin, IMAGE, Slider3);

MakeSlot(Oper:BODout);

Oper:BODout = 9.915;

SetSlotOption(Oper:BODout, IMAGE, Slider4);

MakeSlot(Oper:Q1);

SetSlotOption(Oper:Q1, VALUE_TYPE, NUMBER);

Oper:Q1 = 4.756;

SetSlotOption(Oper:Q1, IMAGE, Slider6);

MakeSlot(Oper:Fin);

Oper:Fin = 524.514;

SetSlotOption(Oper:Fin, IMAGE, Slider7);

MakeSlot(Oper:Lil);

Oper:Lil = 1.862;

SetSlotOption(Oper:Lil, IMAGE, Slider5);

MakeSlot(Oper:Q2);

SetSlotOption(Oper:Q2, VALUE_TYPE, NUMBER);

Oper:Q2 = 3.056;

SetSlotOption(Oper:Q2, IMAGE, Slider6_0);

MakeSlot(Oper:Q3);

SetSlotOption(Oper:Q3, VALUE_TYPE, NUMBER);

Oper:Q3 = 3.2519;

SetSlotOption(Oper:Q3, IMAGE, Slider6_1);

MakeSlot(Oper:P1);

SetSlotOption(Oper:P1, VALUE_TYPE, NUMBER);

Oper:P1 = 30;

SetSlotOption(Oper:P1, IMAGE, Slider9);

MakeSlot(Oper:P2);

SetSlotOption(Oper:P2, VALUE_TYPE, NUMBER);

Oper:P2 = 30;

SetSlotOption(Oper:P2, IMAGE, Slider10);

MakeSlot(Oper:P3);

SetSlotOption(Oper:P3, VALUE_TYPE, NUMBER);

Oper:P3 = 30;

SetSlotOption(Oper:P3, IMAGE, Slider11);

MakeSlot(Oper:P4);

SetSlotOption(Oper:P4, VALUE_TYPE, NUMBER);

Oper:P4 = 30;

SetSlotOption(Oper:P4, IMAGE, Slider8);

MakeSlot(Oper:P5);

SetSlotOption(Oper:P5, VALUE_TYPE, NUMBER);

Oper:P5 = 30;

SetSlotOption(Oper:P5, IMAGE, Slider10_4);

MakeSlot(Oper:P6);

SetSlotOption(Oper:P6, VALUE_TYPE, NUMBER);

Oper:P6 = 30;

SetSlotOption(Oper:P6, IMAGE, Slider10_5);

MakeSlot(Oper:P7);

SetSlotOption(Oper:P7, VALUE_TYPE, NUMBER);

Oper:P7 = 30;

SetSlotOption(Oper:P7, IMAGE, Slider10_6);

MakeSlot(Oper:Pkom);

SetSlotOption(Oper:Pkom, VALUE_TYPE, NUMBER);

Oper:Pkom = 28.272;

SetSlotOption(Oper:Pkom, IMAGE, Slider9_8);

 

/** INSTANCE: Button1 ‑ кнопка «Пуск» **/

MakeInstance(Button1, Button);

Button1:SessionNumber = 0;

Button1:Title = Пуск;

Button1:Visible = TRUE;

Button1:X = 774;

Button1:Y = 327;

SetValue(Button1:BackgroundColor, 0, 128, 64);

Button1:Action = Main;

Button1:FunctionKey = NULL;

ResetImage(Button1);

 

/** INSTANCE: Button2 – «Стоп» **/

MakeInstance(Button2, Button);

Button2:SessionNumber = 0;

Button2:Title = Стоп;

Button2:Visible = TRUE;

Button2:X = 775;

Button2:Y = 358;

SetValue(Button2:BackgroundColor, 255, 0, 0);

Button2:Width = 100;

Button2:Height = 24;

Button2:Action = Stop;

Button2:FunctionKey = NULL;

ResetImage(Button2);

 

/** INSTANCE: Button3 – «закрыть» - окно оператора **/

MakeInstance(Button3, Button);

Button3:SessionNumber = 0;

Button3:Title = Закрыть;

Button3:Visible = TRUE;

Button3:X = 780;

Button3:Y = 390;

SetValue(Button3:BackgroundColor, 128, 128, 0);

Button3:FunctionKey = NULL;

Button3:Action = Fend;

ResetImage(Button3);

 

/** INSTANCE: Button5 - вызов окна установки текущих значений Session1 **/

MakeInstance(Button5, Button);

Button5:SessionNumber = 0;

Button5:Title = Тест;

Button5:Visible = TRUE;

Button5:X = 613;

Button5:Y = 326;

SetValue(Button5:BackgroundColor, 86, 143, 194);

Button5:FunctionKey = NULL;

Button5:Action = ShowSession1;

Button5:Width = 122;

Button5:Height = 25;

ResetImage(Button5);

 

/** INSTANCE: Button7 – вызов формы заполнения БД Session3 **/

MakeInstance(Button7, Button);

Button7:SessionNumber = 0;

Button7:Title = "Эксплуатационные пороги";

Button7:Visible = TRUE;

Button7:X = 612;

Button7:Y = 362;

SetValue(Button7:BackgroundColor, 128, 255, 255);

Button7:FunctionKey = NULL;

Button7:Width = 123;

Button7:Height = 42;

Button7:Action = ShowSession3;

ResetImage(Button7);

 

/** INSTANCE: Button11 –просмотр значений БД **/

MakeInstance(Button11, Button);

Button11:SessionNumber = 3;

Button11:Title = Просмотр;

Button11:Visible = TRUE;

Button11:X = 272;

Button11:Y = 46;

SetValue(Button11:ForegroundColor, 0, 0, 0);

SetValue(Button11:BackgroundColor, 255, 128, 128);

Button11:Font = "MS Sans Serif";

Button11:TextSize = 8;

Button11:Bold = TRUE;

Button11:Underline = FALSE;

Button11:Italic = FALSE;

Button11:StrikeOut = FALSE;

Button11:FunctionKey = NULL;

Button11:Action = OpenBD;

ResetImage(Button11);

 

/** INSTANCE: Button4 - запись в БД **/

MakeInstance(Button4, Button);

Button4:SessionNumber = 3;

Button4:Title = Запись;

Button4:Visible = TRUE;

Button4:X = 271;

Button4:Y = 220;

SetValue(Button4:BackgroundColor, 255, 128, 64);

Button4:Action = ReadBD;

Button4:FunctionKey = NULL;

ResetImage(Button4);

 

/** INSTANCE: Transcript1 <- пример создания поля для вывода текста **/

MakeInstance(Transcript1, Transcript);

Transcript1:SessionNumber = 0;

Transcript1:Title = NULL;

Transcript1:Visible = TRUE;

Transcript1:X = 78;

Transcript1:Y = 31;

SetValue(Transcript1:ForegroundColor, 128, 0, 0);

Transcript1:Font = "MS Sans Serif";

Transcript1:TextSize = 12;

Transcript1:Bold = TRUE;

Transcript1:Underline = FALSE;

Transcript1:Italic = FALSE;

Transcript1:StrikeOut = FALSE;

Transcript1:VertScroll = AUTO;

Transcript1:HorzScroll = AUTO;

Transcript1:Width = 341;

Transcript1:Height = 73;

ResetImage(Transcript1);

 

/** создание правил **/

/** RULE: Konf2 –разрешение конфликтов ситуации 3 –«засорение аэратора» **/

MakeRule(Konf2, [],

Global:u #= kon2,

{

If (Pr31:StPr31 #= 1)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr31:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr31:Kr31));

DisplayText(Transcript6, FormatValue("%s\n", Pr31:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Global:Null));

DisplayText(Transcript5, FormatValue("%s\n", Global:Null));

DisplayText(Transcript7, FormatValue("%s\n", Global:Null));

};

If (Pr32:StPr32 #= 1)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr32:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr32:Kr32));

DisplayText(Transcript6, FormatValue("%s\n", Pr32:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Global:Null));

DisplayText(Transcript5, FormatValue("%s\n", Global:Null));

DisplayText(Transcript7, FormatValue("%s\n", Global:Null));

};

If (Pr33:StPr33 #= 1)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr33:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr33:Kr33));

DisplayText(Transcript6, FormatValue("%s\n", Pr33:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Global:Null));

DisplayText(Transcript5, FormatValue("%s\n", Global:Null));

DisplayText(Transcript7, FormatValue("%s\n", Global:Null));

};

If (Pr34:StPr34 #= 1)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr34:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr34:Kr34));

DisplayText(Transcript6, FormatValue("%s\n", Pr34:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Global:Null));

DisplayText(Transcript5, FormatValue("%s\n", Global:Null));

DisplayText(Transcript7, FormatValue("%s\n", Global:Null));

};

If (Pr35:StPr35 #= 1)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr35:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr35:Kr35));

DisplayText(Transcript6, FormatValue("%s\n", Pr35:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Global:Null));

DisplayText(Transcript5, FormatValue("%s\n", Global:Null));

DisplayText(Transcript7, FormatValue("%s\n", Global:Null));

};

If (Pr36:StPr36 #= 1)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr36:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr36:Kr36));

DisplayText(Transcript6, FormatValue("%s\n", Pr36:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Global:Null));

DisplayText(Transcript5, FormatValue("%s\n", Global:Null));

DisplayText(Transcript7, FormatValue("%s\n", Global:Null));

};

If (Pr37:StPr37 #= 1)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr37:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr37:Kr37));

DisplayText(Transcript6, FormatValue("%s\n", Pr37:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Global:Null));

DisplayText(Transcript5, FormatValue("%s\n", Global:Null));

DisplayText(Transcript7, FormatValue("%s\n", Global:Null));

};

Global:u = kon3;

});

 

/** RULE: Int_S – определение проявившихся ситуаций **/

MakeRule(Int_S, [],

Global:u #= int,

{

Global:u = end;

If (Oper:Lil > GetNthElem(BD:Max, 5))

Then {

DisplayText(Transcript1, FormatValue("%s\n", s1:text));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 5)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 5)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 5)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:Lil));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 5)));

s1:Sts1 = 1;

}

Else {

s1:Sts1 = 0;

};

If (Oper:Pkom > GetNthElem(BD:Min, 15))

Then {

DisplayText(Transcript1, FormatValue("%s\n", s2:text));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 15)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 15)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 15)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:Pkom));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 15)));

s2:Sts2 = 1;

}

Else {

s2:Sts2 = 0;

};

If (s2:Sts2 == 0 And (Oper:P1 > GetNthElem(BD:Max, 8)

Or Oper:P2 > GetNthElem(BD:Max,9)

Or Oper:P3 > GetNthElem(BD:Max,10)

Or Oper:P4 > GetNthElem(BD:Max,11)

Or Oper:P5 > GetNthElem(BD:Max,12)

Or Oper:P6 > GetNthElem(BD:Max, 13)

Or Oper:P7 > GetNthElem(BD:Max,14)))

Then {

DisplayText(Transcript1, FormatValue("%s\n", s3:text));

s3:Sts3 = 1;

}

Else {

s3:Sts3 = 0;

};

If (Oper:BODin < GetNthElem(BD:Min, 1))

Then {

DisplayText(Transcript1, FormatValue("%s\n", s4:text));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 1)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 1)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 1)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:BODin));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 1)));

s4:Sts4 = 1;

}

Else {

s4:Sts4 = 0;

};

If (Oper:BODin > GetNthElem(BD:Max, 1) And Oper:BODout > GetNthElem(BD:Max, 2) And s3:Sts3 == 0 And s1:Sts1 == 0)

Then {

DisplayText(Transcript1, FormatValue("%s\n", s5:text));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 1)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 1)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 1)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:BODin));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 1)));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 2)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 2)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 2)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:BODout));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 2)));

s5:Sts5 = 1;

}

Else {

s5:Sts5 = 0;

};

Global:u = s6;

});

 

/*RULE:Int_Pr2 определение причин выявленных ситуаций, подсчёт критериев развития */

MakeRule(Int_Pr2, [],

Global:u #= prih2,

{

If (s5:Sts5 == 1 And Oper:Q1 < GetNthElem(BD:Min, 3))

Then {

Pr51:StPr51 = 1;

Global:C1 = Abs(Oper:BODin - GetNthElem(BD:Max, 1)) / 150;

Global:C2 = Abs(Oper:BODout - GetNthElem(BD:Max, 2)) / 33;

Global:C3 = Abs(Oper:Q1 - GetNthElem(BD:Min, 3)) / 1.5;

Global:C4 = 1;

Pr51:Kr51 = (Global:C1 + Global:C2 + Global:C3 + Global:C4+ Global:C4) / 5;

}

Else {

Pr51:StPr51 = 0;

};

If (s5:Sts5 == 1 And Oper:Q2 < GetNthElem(BD:Min, 6))

Then {

Pr52:StPr52 = 1;

Global:C1 = Abs(Oper:BODin - GetNthElem(BD:Max, 1)) / 150;

Global:C2 = Abs(Oper:Q2 - GetNthElem(BD:Min, 6)) / 0.5;

Global:C3 = Abs(Oper:BODout - GetNthElem(BD:Max, 2))/ 33;

Global:C4 = 1;

Pr52:Kr52 = (Global:C1 + Global:C2 + Global:C3 + Global:C4+ Global:C4) / 5;

}

Else {

Pr52:StPr52 = 0;

};

If (s5:Sts5 == 1 And Oper:Q3 < GetNthElem(BD:Min, 7))

Then {

Pr53:StPr53 = 1;

Global:C1 = Abs(Oper:BODin - GetNthElem(BD:Max, 1)) / 150;

Global:C2 = Abs(Oper:Q3 - GetNthElem(BD:Min, 7)) / 0.5;

Global:C3 = Abs(Oper:BODout - GetNthElem(BD:Max, 2)) / 33;

Global:C4 = 1;

Pr53:Kr53 = (Global:C1 + Global:C2 + Global:C3 + Global:C4+ Global:C4) / 5;

}

Else {

Pr53:StPr53 = 0;

};

Global:u = dis;

});

 

/** RULE: Display **/

MakeRule(Display, [],

Global:u #= dis,

{

If (Pr12:StPr12 == 1)

Then {

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 1)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 1)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 1)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:BODin));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 1)));

};

If (Pr11:StPr11 == 1)

Then {

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 4)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 4)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 4)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:Fin));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 4)));

};

If (Pr31:StPr31 == 1)

Then {

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 8)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 8)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 8)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:P1));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 8)));

};

If (Pr32:StPr32 == 1)

Then {

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 9)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 9)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 9)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:P2));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 9)));

};

If (Pr33:StPr33 == 1)

Then {

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 10)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 10)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 10)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:P3));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 10)));

};

If (Pr34:StPr34 == 1)

Then {

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 11)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 11)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 11)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:P4));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 11)));

};

If (Pr35:StPr35 == 1)

Then {

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 12)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 10)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 10)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:P5));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 10)));

};

If (Pr36:StPr36 == 1)

Then {

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 13)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 10)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 10)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:P6));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 10)));

};

If (Pr37:StPr37 == 1)

Then {

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 14)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 10)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 10)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:P7));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 10)));

};

If (Pr51:StPr51 == 1)

Then {

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 3)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 3)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 3)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:Q1));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 3)));

};

If (Pr52:StPr52 == 1)

Then {

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 6)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 6)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 6)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:Q2));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 6)));

};

If (Pr53:StPr53 == 1)

Then {

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 7)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 7)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 7)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:Q3));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 7)));

};

Global:u = kon1;

});

 

/** RULE: Konf1 **/

MakeRule(Konf1, [],

Global:u #= kon1,

{

If (Pr12:StPr12 #= 1 And Pr11:StPr11 #= 1 And Pr11:Kr11 > Pr12:Kr12)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr11:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr11:Kr11));

DisplayText(Transcript6, FormatValue("%s\n", Pr11:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Pr12:textPr));

DisplayText(Transcript5, FormatValue("%s\n", Pr12:Kr12));

DisplayText(Transcript7, FormatValue("%s\n", Pr12:textRec));

};

If (Pr12:StPr12 #= 1 And Pr11:StPr11 #= 1 And Pr12:Kr12 >= Pr11:Kr11)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr12:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr12:Kr12));

DisplayText(Transcript6, FormatValue("%s\n", Pr12:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Pr11:textPr));

DisplayText(Transcript5, FormatValue("%s\n", Pr11:Kr11));

DisplayText(Transcript7, FormatValue("%s\n", Pr11:textRec));

};

If (Pr11:StPr11 == 1 And Pr12:StPr12 == 0)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr11:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr11:Kr11));

DisplayText(Transcript6, FormatValue("%s\n", Pr11:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Global:Null));

DisplayText(Transcript5, FormatValue("%s\n", Global:Null));

DisplayText(Transcript7, FormatValue("%s\n", Global:Null));

};

If (Pr12:StPr12 == 1 And Pr11:StPr11 == 0)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr12:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr12:Kr12));

DisplayText(Transcript6, FormatValue("%s\n", Pr12:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Global:Null));

DisplayText(Transcript5, FormatValue("%s\n", Global:Null));

DisplayText(Transcript7, FormatValue("%s\n", Global:Null));

};

Global:u = kon2;

});

 

/** RULE: Konf3 **/

MakeRule(Konf3, [],

Global:u #= kon3,

{

If (Pr51:StPr51 #= 1And Pr52:StPr52#= 1And Pr53:StPr53 #= 1 And Pr51:Kr51 > Pr52:Kr52 And Pr51:Kr51 > Pr53:Kr53)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr51:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr51:Kr51));

DisplayText(Transcript6, FormatValue("%s\n", Pr51:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Pr52:textPr));

DisplayText(Transcript5, FormatValue("%s\n", Pr52:Kr52));

DisplayText(Transcript7, FormatValue("%s\n", Pr52:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Pr53:textPr));

DisplayText(Transcript5, FormatValue("%s\n", Pr53:Kr53));

DisplayText(Transcript7, FormatValue("%s\n", Pr53:textRec));

};

If (Pr51:StPr51#=1 And Pr52:StPr52 #=1 And Pr53:StPr53#=1 And Pr52:Kr52 >= Pr51:Kr51 And Pr52:Kr52 >=Pr53:Kr53)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr52:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr52:Kr52));

DisplayText(Transcript6, FormatValue("%s\n", Pr52:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Pr51:textPr));

DisplayText(Transcript5, FormatValue("%s\n", Pr51:Kr51));

DisplayText(Transcript7, FormatValue("%s\n", Pr51:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Pr53:textPr));

DisplayText(Transcript5, FormatValue("%s\n", Pr53:Kr53));

DisplayText(Transcript7, FormatValue("%s\n", Pr53:textRec));

};

If (Pr51:StPr51 #=1 And Pr52:StPr52#=1 And Pr53:StPr53#=1 And Pr53:Kr53 >= Pr51:Kr51 And Pr53:Kr53 > Pr52:Kr52)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr53:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr53:Kr53));

DisplayText(Transcript6, FormatValue("%s\n", Pr53:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Pr51:textPr));

DisplayText(Transcript5, FormatValue("%s\n", Pr51:Kr51));

DisplayText(Transcript7, FormatValue("%s\n", Pr51:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Pr52:textPr));

DisplayText(Transcript5, FormatValue("%s\n", Pr52:Kr52));

DisplayText(Transcript7, FormatValue("%s\n", Pr52:textRec));

};

If (Pr51:StPr51 #=1 And Pr52:StPr52#=1 And Pr53:StPr53#=0 And Pr51:Kr51 > Pr52:Kr52)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr51:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr51:Kr51));

DisplayText(Transcript6, FormatValue("%s\n", Pr51:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Pr52:textPr));

DisplayText(Transcript5, FormatValue("%s\n", Pr52:Kr52));

DisplayText(Transcript7, FormatValue("%s\n", Pr52:textRec));

};

If (Pr52:StPr52 #=1 And Pr51:StPr51#=1 And Pr53:StPr53#=0 And Pr52:Kr52>= Pr51:Kr51)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr52:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr52:Kr52));

DisplayText(Transcript6, FormatValue("%s\n", Pr52:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Pr51:textPr));

DisplayText(Transcript5, FormatValue("%s\n", Pr51:Kr51));

DisplayText(Transcript7, FormatValue("%s\n", Pr51:textRec));

};

If (Pr51:StPr51#=1 And Pr53:StPr53#=1 And Pr52:StPr52#= 0 And Pr51:Kr51 > Pr53:Kr53)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr51:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr51:Kr51));

DisplayText(Transcript6, FormatValue("%s\n", Pr51:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Pr53:textPr));

DisplayText(Transcript5, FormatValue("%s\n", Pr53:Kr53));

DisplayText(Transcript7, FormatValue("%s\n", Pr53:textRec));

};

If (Pr53:StPr53#=1 And Pr51:StPr51#=1 And Pr52:StPr52#=0 And Pr53:Kr53>= Pr51:Kr51)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr53:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr53:Kr53));

DisplayText(Transcript6, FormatValue("%s\n", Pr53:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Pr51:textPr));

DisplayText(Transcript5, FormatValue("%s\n", Pr51:Kr51));

DisplayText(Transcript7, FormatValue("%s\n", Pr51:textRec));

};

If (Pr53:StPr53#=1 And Pr52:StPr52 #=1 And Pr51:StPr51#=0 And Pr53:Kr53 > Pr52:Kr52)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr53:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr53:Kr53));

DisplayText(Transcript6, FormatValue("%s\n", Pr53:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Pr52:textPr));

DisplayText(Transcript5, FormatValue("%s\n", Pr52:Kr52));

DisplayText(Transcript7, FormatValue("%s\n", Pr52:textRec));

};

If (Pr52:StPr52#=1 And Pr53:StPr53#=1 And Pr51:StPr51#=0 And Pr52:Kr52>= Pr53:Kr53)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr52:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr52:Kr52));

DisplayText(Transcript6, FormatValue("%s\n", Pr52:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Pr53:textPr));

DisplayText(Transcript5, FormatValue("%s\n", Pr53:Kr53));

DisplayText(Transcript7, FormatValue("%s\n", Pr53:textRec));

};

Global:u = kon4;

});

 

/** RULE: Konf4 **/

MakeRule(Konf4, [],

Global:u #= kon4,

{

If (Pr41:StPr41 == 1)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr41:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr41:Kr41));

DisplayText(Transcript6, FormatValue("%s\n", Pr41:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Global:Null));

DisplayText(Transcript5, FormatValue("%s\n", Global:Null));

DisplayText(Transcript7, FormatValue("%s\n", Global:Null));

};

If (Pr51:StPr51 == 1 And Pr52:StPr52 #= 0 And Pr53:StPr53 #= 0)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr51:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr51:Kr51));

DisplayText(Transcript6, FormatValue("%s\n", Pr51:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Global:Null));

DisplayText(Transcript5, FormatValue("%s\n", Global:Null));

DisplayText(Transcript7, FormatValue("%s\n", Global:Null));

};

If (Pr52:StPr52 == 1 And Pr51:StPr51 #= 0 And Pr53:StPr53#= 0)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr52:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr52:Kr52));

DisplayText(Transcript6, FormatValue("%s\n", Pr52:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Global:Null));

DisplayText(Transcript5, FormatValue("%s\n", Global:Null));

DisplayText(Transcript7, FormatValue("%s\n", Global:Null));

};

If (Pr53:StPr53 == 1 And Pr51:StPr51 #= 0 And Pr52:StPr52#= 0)

Then {

DisplayText(Transcript2, FormatValue("%s\n", Pr53:textPr));

DisplayText(Transcript3, FormatValue("%s\n", Pr53:Kr53));

DisplayText(Transcript6, FormatValue("%s\n", Pr53:textRec));

DisplayText(Transcript4, FormatValue("%s\n", Global:Null));

DisplayText(Transcript5, FormatValue("%s\n", Global:Null));

DisplayText(Transcript7, FormatValue("%s\n", Global:Null));

};

Global:u = end;

});

 

/** RULE: Int_S6 – ситуация «процесс идёт нормально» **/

MakeRule(Int_S6, [],

Global:u #= s6,

{

If (s1:Sts1 == 0 And s2:Sts2 == 0 And s3:Sts3 == 0 And s4:Sts4== 0 And s5:Sts5 == 0)

Then { /** вывод всех параметров процесса на экран**/

DisplayText(Transcript1, FormatValue("%s\n", s6:text));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 2)));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 1)));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 4)));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 3)));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 6)));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 7)));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 5)));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 8)));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 9)));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 10)));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 11)));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 12)));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 13)));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 14)));

DisplayText(Transcript8, FormatValue("%s\n", GetNthElem(BD:Name, 15)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 2)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 1)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 4)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 3)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 6)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 7)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 5)));

DisplayText(Transcript9, FormatValue("%s\n\n\n\n\n\n\n",GetNthElem(BD:Eiz, 8)));

DisplayText(Transcript9, FormatValue("%s\n", GetNthElem(BD:Eiz, 15)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 2)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 1)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 4)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 3)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 6)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 7)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 5)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 8)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 9)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 10)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 11)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 12)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 13)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 14)));

DisplayText(Transcript10, FormatValue("%s\n", GetNthElem(BD:Min, 15)));

DisplayText(Transcript11, FormatValue("%s\n", Oper:BODout));

DisplayText(Transcript11, FormatValue("%s\n", Oper:BODin));

DisplayText(Transcript11, FormatValue("%s\n", Oper:Fin));

DisplayText(Transcript11, FormatValue("%s\n", Oper:Q1));

DisplayText(Transcript11, FormatValue("%s\n", Oper:Q2));

DisplayText(Transcript11, FormatValue("%s\n", Oper:Q3));

DisplayText(Transcript11, FormatValue("%s\n", Oper:Lil));

DisplayText(Transcript11, FormatValue("%s\n", Oper:P1));

DisplayText(Transcript11, FormatValue("%s\n", Oper:P2));

DisplayText(Transcript11, FormatValue("%s\n", Oper:P3));

DisplayText(Transcript11, FormatValue("%s\n", Oper:P4));

DisplayText(Transcript11, FormatValue("%s\n", Oper:P5));

DisplayText(Transcript11, FormatValue("%s\n", Oper:P6));

DisplayText(Transcript11, FormatValue("%s\n", Oper:P7));

DisplayText(Transcript11, FormatValue("%s\n", Oper:Pkom));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 2)));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 1)));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 4)));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 3)));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 6)));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 7)));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 5)));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 8)));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 9)));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 10)));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 11)));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 12)));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 13)));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 14)));

DisplayText(Transcript12, FormatValue("%s\n", GetNthElem(BD:Max, 15)));

s6:Sts6 = 1;

};

Global:u = prih;

});

 

/** RULE: Int_Pr1 **/

MakeRule(Int_Pr1, [],

Global:u #= prih,

{

If (s1:Sts1 == 1 And Oper:Fin > GetNthElem(BD:Max, 4))

Then {

Pr11:StPr11 = 1;

Global:C1 = Abs(Oper:Lil - GetNthElem(BD:Max, 5)) / 0.5;

Global:C2 = Abs(Oper:Fin - GetNthElem(BD:Max, 4)) / 40;

Pr11:Kr11 = (Global:C1 + Global:C2) / 2;

}

Else {

Pr11:StPr11 = 0;

};

If (s1:Sts1 == 1 And Oper:BODin > GetNthElem(BD:Max, 1))

Then {

Pr12:StPr12 = 1;

Global:C1 = Abs(Oper:Lil - GetNthElem(BD:Max, 5)) / 0.5;

Global:C2 = Abs(Oper:BODin - GetNthElem(BD:Max, 1)) / 150;

Pr12:Kr12 = (Global:C1 + Global:C2) / 2;

}

Else {

Pr12:StPr12 = 0;

};

If (s3:Sts3 == 1 And Oper:P1 > GetNthElem(BD:Max, 8))

Then {

Pr31:StPr31 = 1;

Pr31:Kr31 = Abs(Oper:P1 - GetNthElem(BD:Max, 8)) / 10;

}

Else {

Pr31:StPr31 = 0;

};

If (s3:Sts3 == 1 And Oper:P2 > GetNthElem(BD:Max, 9))

Then {

Pr32:StPr32 = 1;

Pr32:Kr32 = Abs(Oper:P2 - GetNthElem(BD:Max, 9)) / 10;

}

Else {

Pr32:StPr32 = 0;

};

If (s3:Sts3 == 1 And Oper:P3 > GetNthElem(BD:Max, 10))

Then {

Pr33:StPr33 = 1;

Pr33:Kr33 = Abs(Oper:P3 - GetNthElem(BD:Max, 10)) / 10;

}

Else {

Pr33:StPr33 = 0;

};

If (s3:Sts3 == 1 And Oper:P4 > GetNthElem(BD:Max, 11))

Then {

Pr34:StPr34 = 1;

Pr34:Kr34 = Abs(Oper:P4 - GetNthElem(BD:Max, 11)) / 10;

}

Else {

Pr34:StPr34 = 0;

};

If (s3:Sts3 == 1 And Oper:P5 > GetNthElem(BD:Max, 12))

Then {

Pr35:StPr35 = 1;

Pr35:Kr35 = Abs(Oper:P5 - GetNthElem(BD:Max, 12)) / 10;

}

Else {

Pr35:StPr35 = 0;

};

If (s3:Sts3 == 1 And Oper:P6 > GetNthElem(BD:Max, 13))

Then {

Pr36:StPr36 = 1;

Pr36:Kr36 = Abs(Oper:P6 - GetNthElem(BD:Max, 13)) / 10;

}

Else {

Pr36:StPr36 = 0;

};

If (s3:Sts3 == 1 And Oper:P7 > GetNthElem(BD:Max, 14))

Then {

Pr37:StPr37 = 1;

Pr37:Kr37 = Abs(Oper:P7 - GetNthElem(BD:Max, 14)) / 10;

}

Else {

Pr37:StPr37 = 0;

};

If (s4:Sts4 == 1 And Oper:BODout > GetNthElem(BD:Max, 2))

Then {

Pr41:StPr41 = 1;

Global:C1 = Abs(Oper:BODin - GetNthElem(BD:Min, 1)) / 130;

Global:C2 = Abs(Oper:BODout - GetNthElem(BD:Max, 2)) / 33;

Pr41:Kr41 = (Global:C1 + Global:C2) / 2;

}

Else {

Pr41:StPr41 = 0;

};

Global:u = prih2;

});

/** GOAL: Stopp **/

MakeGoal(Stopp,

{

Global:u #= end;

});


Дата добавления: 2015-07-15; просмотров: 55 | Нарушение авторских прав


Читайте в этой же книге: Проектное конфигурирование контроллера | Описание структуры экспертной системы | Анализ процесса биологической очистки с точки зрения возможных аварийных и нештатных ситуаций | Выбор модели представления знаний в экспертной системе | Построение базы знаний | Описание экспертной оболочки КАРРА V 2.4 | Описание процесса и результатов работы экспертной системы | Расчет капитальных вложений по автоматизации блока биологической очистки бытовых сточных вод | Расчет трудоемкости ремонтных работ и обслуживания приборов и средств автоматизации | Расчет эксплуатационных затрат на систему автоматизации блока биологической очистки |
<== предыдущая страница | следующая страница ==>
Список использованных источников| Об этой книге, умной бахче и умных бахчеводах

mybiblioteka.su - 2015-2024 год. (0.27 сек.)