GUI code for different sections is in following sections

Similar documents
% Edit the above text to modify the response to help Video_Player. % Last Modified by GUIDE v May :38:12

LAMPIRAN 1. Percobaan

Signal and Systems. Matlab GUI based analysis. XpertSolver.com

1. Peralatan LAMPIRAN

% Edit the above text to modify the response to help Principal

LISTING PROGRAM. % UIWAIT makes pertama wait for user response (see UIRESUME) % uiwait(handles.figure1);

Homeworks on FFT Instr. and Meas. for Communication Systems- Gianfranco Miele. Name Surname

LISTING PROGRAM. % Edit the above text to modify the response to help cover. % Last Modified by GUIDE v Jun :24:43

Supplementary Information

We are IntechOpen, the world s leading publisher of Open Access books Built by scientists, for scientists. International authors and editors

MV 1:00 1:05 1:00 1:05

LAMPIRAN A PROGRAM PELATIHAN DAN PENGUJIAN

OMR Sheet Recognition

A NEW MACHINING COST CALCULATOR (MC 2 )

Ear Recognition. By: Zeyangyi Wang

Akkad Bakad Bambai Bo

Lampiran 1. Script M-File Global Ridge

1.Matlab Image Encryption Code

% --- Executes on button press in btn_gsn. function btn_gsn_callback(hobject, eventdata, handles) GaussianSpeckleNoise close AiSoftware;

Lithium-Ion Battery Data. Management

Finding a Minimum Covering Circle Based on Infinity Norms

ECE Fall 05. Undergraduate Research: Digital Signal Processing & Quantization Effects

LAMPIRAN LISTING PROGRAM

LAMPIRAN A LISTINGPROGRAM

PROGRAMMING IN MATLAB

Airfoil Boundary Layer Separation Prediction

LISTING PROGRAM. if nargout [varargout{1:nargout}] = gui_mainfcn(gui_state, varargin{:}); else gui_mainfcn(gui_state, varargin{:}); end

Contents INTERFACING MATLAB WITH EMBEDDED SYSTEMS

Solving Sudoku with MATLAB

.., 7. References. [ 1] 1 mage Analysis and Mathematical Morphology:J.Serra. [2] Erosion, dilation and related operators,by Mariusz Jankowski

Main Form visual Studio

GUI Signal Analysis and Filtering Design

COMPLETELY AUTOMATED PUBLIC TURING TEST TO TELL COMPUTERS AND HUMANS APART

Parallel-connected solar arrays

ALGORITHMS AND INTERFACE FOR OCEAN ACOUSTIC RAY-TRACING (Developed in MATLAB)

Real-Time IIR Digital Filters

Implementation of a Motion Detection System

Accepted by... John H. Lienhard V

MEASURING INTERFACIAL TENSION WITH THE PENDANT DROP METHOD

TREBALL FINAL DE GRAU

LOK-Viewer : Graphical Interface Application for Geomagnetic Data in Observatory Geomagnetic Lombok

IMAGE STEGANOGRAPHY USING DISCRETE COSINE TRNASFORM ALGORITHM

MATLAB. Creating Graphical User Interfaces Version 7. The Language of Technical Computing

Mathematics Shape and Space: Polygon Angles

Keywords: Learning automata, Vertex multicoloring.

CITY UNIVERSITY OF NEW YORK. Creating a New Project in IRBNet. i. After logging in, click Create New Project on left side of the page.

Design of Automated Digital Eye Palpation Exam for Intraocular Pressure Measurement

1 Lab 3, Simulation of crank-piston system

Corrective Action User Walkthrough: New Portal Login

Mechanism Design using Creo Parametric 3.0

CITY UNIVERSITY OF NEW YORK. i. Visit:

Remote Access Guide.

Step 1: Download the Overdrive Media Console App

GENDER ESTIMATION BASED ON FACIAL IMAGE AZLIN BT YAJID UNIVERSITI TEKNOLOGI MALAYSIA

Q3. Where can I register DuitNow ID? Login to Bank Islam Internet Banking. Go to Settings > DuitNow ID and click on Add button. Refer to image below.

Introduction to PTC Windchill ProjectLink 11.0

UNIVERSITÀ DEGLI STUDI DI PADOVA

Introduction to PTC Windchill PDMLink 11.0 for Heavy Users

Excel Programming with VBA (Macro Programming) 24 hours Getting Started

CROSS-REFERENCE TABLE ASME A Including A17.1a-1997 Through A17.1d 2000 vs. ASME A

Office 2016 Excel Basics 01 Video/Class Project #13 Excel Basics 1: Excel Grid, Formatting, Formulas, Cell References, Page Setup (O16-13)

2.) ilit Welcome Screen

IP Camera Installation Brief Manual

USER GUIDE UTRADE ID Mobile for iphone & ipad

Fundamentals of the Java Programming Language

Tencent QQ Watch. User Manual. Note: Oversea users Need Google Map service China Mainland users need Google service and VPN

Information Infrastructure Initiative, Kyushu University

Benter Niu(Sales Manager&Software Engineer) Skype ID:benter.niu WhatsApp/TEL.: CONTENTS

Introduction to PTC Windchill PDMLink 11.0 for the Implementation Team

ITEC2620 Introduction to Data Structures

Update to Creo Parametric 4.0 from Creo Parametric 2.0

Dark Energy Survey Detector Head Electronics Crate Disassembly & Modular Replacement Instructions For Type 2 DAQ & Heater Crates

II.1 Running a Crystal Report from Infoview

Introduction to Creo Elements/Direct 19.0 Modeling

Annexure I: Contact Details:

BMEGUI Tutorial 1 Spatial kriging

GSM ProTherm PT1000. User Guide

Page 1. MILLION CONCEPT ELECTRONIC (SHENZHEN) CO., LTD. Functional Operation Specification of Product. 3D electronic paper step counter watch

Fónfix Repair Logging System

BFW-037 B.Sc. FOOTWEAR TECHNOLOGY (BSCFWT) Term-End Examination. December, 2014

Using Inspiration 7 I. How Inspiration Looks SYMBOL PALETTE

BSynchro [E-AUTHORIZATION USER GUIDE] BSYNCHRO

Installing SharePoint Server 2007

Introduction to PTC Windchill MPMLink 11.0

Introduction to Java. Handout-3a. cs402 - Spring

CG Transformer Division Laboratories, Crompton Greaves Ltd., Kanjurmarg (East), Mumbai, Maharashtra

"Charting the Course... MOC C: Querying Data with Transact-SQL. Course Summary

INTRODUCTION Background of the Problem Statement of the Problem Objectives of the Study Significance of the Study...

"Charting the Course... SharePoint 2007 Hands-On Labs Course Summary

Report: A Comparison of Synchrophasor Protocols

SHSAT Review Class Week 3-10/21/2016

Ultraplatjoslas radaru izmantošana automašīnu skaitīšanai

716 West Ave Austin, TX USA

"Charting the Course... MOC A Developing Microsoft SQL Server 2012 Databases. Course Summary

OLLSCOIL NA héireann THE NATIONAL UNIVERSITY OF IRELAND COLÁISTE NA hollscoile, CORCAIGH UNIVERSITY COLLEGE, CORK. Summer Examination 2012

Introduction to Windchill PDMLink 10.2 for the Implementation Team

Introduction To MATLAB Interactive Graphics

Contents. Excel 2013 Workbook... 1 Starting Excel The Startup Screen... 3 The Excel Screen... 4 Quick Access Toolbar...

This Document is intended as a user guide for providers who are planning to use the eligibility check system.

Chapter 1. Chapter 2. viii. Understanding the PowerPoint Work Area...1. Getting Started...4. PowerPoint Versions...6. The PowerPoint Work Area...

Transcription:

Software Listing The Graphical User Interface (GUI) and Fuzzy Inference System (FIS) are developed in MATLAB. Software code is developed for different sections like Weaving section, Motor Status, Environment, Emergency Faults and Oil tank condition. Some software code listing is in following sections. GUI code for different sections is in following sections function varargout = Weaving_Section_1(varargin) % WEAVING_SECTION_1 M-file for Weaving_Section_1.fig gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_openingfcn', @Weaving_Section_1_OpeningFcn,... 'gui_outputfcn', @Weaving_Section_1_OutputFcn,... 'gui_layoutfcn', [],... 'gui_callback', []); if nargin && ischar(varargin{1}) gui_state.gui_callback = str2func(varargin{1}); if nargout [varargout{1:nargout}] = gui_mainfcn(gui_state, varargin{:}); else gui_mainfcn(gui_state, varargin{:}); % End initialization code - DO NOT EDIT % --- Executes just before Weaving_Section_1 is made visible. function Weaving_Section_1_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % varargin command line arguments to Weaving_Section_1 (see VARARGIN) % Choose default command line output for Weaving_Section_1 handles.output = hobject; % Update handles structure guidata(hobject, handles); I

% UIWAIT makes Weaving_Section_1 wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = Weaving_Section_1_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % Get default command line output from handles structure varargout{1} = handles.output; % --- Executes on button press in environment_button. function environment_button_callback(hobject, eventdata, handles) % hobject handle to environment_button (see GCBO) %-------------------------------------------------------------- Environment_ConditionFigureHandle = Environment_Condition; %stores the figure handle of Quan's GUI here %stores the GUI data from Quan's GUI here %now we can access any of the data from Quan's GUI!!!! Environment_ConditionData = guidata(environment_conditionfigurehandle); %store the input text from Quan's GUI %into the variable quan_input Environment_Condition_input = get(environment_conditiondata.state_environment,'string'); %set the static text on Daniel's GUI to match the %input text from Quan's GUI set(handles.state_environment,'string',environment_condition_input); %notice that quandata is the structure containing the data from Quan's GUI %notice that handles is the structure containing data from Daniel's GUI, %which is the local GUI (i.e., the GUI that this function is running from) %-------------------------------------------------------------- % --- Executes on button press in pushbutton2. function pushbutton2_callback(hobject, eventdata, handles) % hobject handle to pushbutton2 (see GCBO) %-------------------------------------------------------------- motor_conditionfigurehandle = motor_condition; %stores the figure handle of Quan's GUI here motor_conditiondata = guidata(motor_conditionfigurehandle); motor_condition_input = get(motor_conditiondata.state_motor,'string'); II

set(handles.state_motor,'string',motor_condition_input); %-------------------------------------------------------------- % --- Executes on button press in oil_tank_button. function oil_tank_button_callback(hobject, eventdata, handles) % hobject handle to oil_tank_button (see GCBO) %-------------------------------------------------------------- Oil_TankFigureHandle = Oil_Tank; %stores the figure handle of Quan's GUI here %stores the GUI data from Quan's GUI here %now we can access any of the data from Quan's GUI!!!! Oil_TankData = guidata(oil_tankfigurehandle); %store the input text from Quan's GUI %into the variable quan_input Oil_TankData_input = get(oil_tankdata.state_oil,'string'); set(handles.state_oil,'string',oil_tankdata_input); %-------------------------------------------------------------- % --- Executes on button press in pushbutton4. function pushbutton4_callback(hobject, eventdata, handles) % hobject handle to pushbutton4 (see GCBO) % --- Executes on button press in motherboard_button. function motherboard_button_callback(hobject, eventdata, handles) % hobject handle to motherboard_button (see GCBO) III

function varargout = Environment_Condition(varargin) % ENVIRONMENT_CONDITION M-file for Environment_Condition.fig % Begin initialization code - DO NOT EDIT gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_openingfcn', @Environment_Condition_OpeningFcn,... 'gui_outputfcn', @Environment_Condition_OutputFcn,... 'gui_layoutfcn', [],... 'gui_callback', []); if nargin && ischar(varargin{1}) gui_state.gui_callback = str2func(varargin{1}); if nargout [varargout{1:nargout}] = gui_mainfcn(gui_state, varargin{:}); else gui_mainfcn(gui_state, varargin{:}); % End initialization code - DO NOT EDIT % --- Executes just before Environment_Condition is made visible. function Environment_Condition_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % varargin command line arguments to Environment_Condition (see VARARGIN) % Choose default command line output for Environment_Condition handles.output = hobject; % Update handles structure guidata(hobject, handles); % UIWAIT makes Environment_Condition wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = Environment_Condition_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); IV

% Get default command line output from handles structure varargout{1} = handles.output; % --- Executes on button press in pushbutton1. function pushbutton1_callback(hobject, eventdata, handles) % hobject handle to pushbutton1 (see GCBO) environment = evalin('base','environment') a = environment(1,5) switch (a) case 1 set(handles.state_environment,'string','bad'); set(handles.causes_environment,'visible', 'on'); set(handles.possible_envir,'visible', 'on'); set(handles.causes_environment,'string','warning!!! Please check Sprinkler and exaust fan also'); case 2 set(handles.state_environment,'string','medium'); set(handles.causes_environment,'visible', 'on'); set(handles.possible_envir,'visible', 'on'); set(handles.causes_environment,'string','please check Exaust fan'); case 3 set(handles.state_environment,'string','good'); set(handles.causes_environment,'visible', 'off'); set(handles.possible_envir,'visible', 'off'); otherwise set(handles.state_environment,'string','--'); set(handles.causes_environment,'visible', 'on'); set(handles.possible_envir,'visible', 'on'); set(handles.causes_environment,'string',''); a = environment(1,2) set(handles.temperature,'string',a); a = environment(2,2) set(handles.humidity,'string',a); V

function varargout = Motor_Condition(varargin) % MOTOR_CONDITION M-file for Motor_Condition.fig % MOTOR_CONDITION, by itself, creates a new MOTOR_CONDITION or raises the existing % singleton*. gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_openingfcn', @Motor_Condition_OpeningFcn,... 'gui_outputfcn', @Motor_Condition_OutputFcn,... 'gui_layoutfcn', [],... 'gui_callback', []); if nargin && ischar(varargin{1}) gui_state.gui_callback = str2func(varargin{1}); if nargout [varargout{1:nargout}] = gui_mainfcn(gui_state, varargin{:}); else gui_mainfcn(gui_state, varargin{:}); % End initialization code - DO NOT EDIT % --- Executes just before Motor_Condition is made visible. function Motor_Condition_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % varargin command line arguments to Motor_Condition (see VARARGIN) % Choose default command line output for Motor_Condition handles.output = hobject; % Update handles structure guidata(hobject, handles); % UIWAIT makes Motor_Condition wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = Motor_Condition_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % Get default command line output from handles structure varargout{1} = handles.output; VI

% --- Executes during object creation, after setting all properties. function edit1_createfcn(hobject, eventdata, handles) % hobject handle to edit1 (see GCBO) % handles empty - handles not created until after all CreateFcns called function causes_motor_callback(hobject, eventdata, handles) % hobject handle to causes_motor (see GCBO) % Hints: get(hobject,'string') returns contents of causes_motor as text % str2double(get(hobject,'string')) returns contents of causes_motor as a double % --- Executes during object creation, after setting all properties. function causes_motor_createfcn(hobject, eventdata, handles) % hobject handle to causes_motor (see GCBO) % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hobject,'backgroundcolor'), get(0,'defaultuicontrolbackgroundcolor')) set(hobject,'backgroundcolor','white'); % --- Executes on button press in pushbutton1. function pushbutton1_callback(hobject, eventdata, handles) % hobject handle to pushbutton1 (see GCBO) motor = evalin('base','motor') a = motor(4,5) switch(a) case 1 set(handles.state_motor,'string','open Phase'); set(handles.causes_motor,'string','warning!!! Check the phases'); set(handles.causes_motor,'visible', 'on'); set(handles.possible_motor,'visible', 'on'); case 2 set(handles.state_motor,'string','damage'); set(handles.causes_motor,'string','warning!!! Motor Damage, Please check load'); set(handles.causes_motor,'visible', 'on'); VII

set(handles.possible_motor,'visible', 'on'); case 3 set(handles.state_motor,'string','critically Overload'); set(handles.causes_motor,'string','warning!!! Load is very heavy, Please check load'); set(handles.causes_motor,'visible', 'on'); set(handles.possible_motor,'visible', 'on'); case 4 set(handles.state_motor,'string','overload'); set(handles.causes_motor,'string','warning!!! Please check load'); set(handles.causes_motor,'visible', 'on'); set(handles.possible_motor,'visible', 'on'); case 5 set(handles.state_motor,'string','good'); set(handles.causes_motor,'visible', 'off'); set(handles.possible_motor,'visible', 'off'); otherwise set(handles.state_motor,'string','--'); set(handles.causes_motor,'string',''); set(handles.causes_motor,'visible', 'on'); set(handles.possible_motor,'visible', 'on'); a = motor(4,2) set(handles.ir1,'string',a); a = motor(4,3) set(handles.iy1,'string',a) a = motor(4,4) set(handles.ib1,'string',a); VIII

function varargout = Oil_Tank(varargin) % OIL_TANK M-file for Oil_Tank.fig gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_openingfcn', @Oil_Tank_OpeningFcn,... 'gui_outputfcn', @Oil_Tank_OutputFcn,... 'gui_layoutfcn', [],... 'gui_callback', []); if nargin && ischar(varargin{1}) gui_state.gui_callback = str2func(varargin{1}); if nargout [varargout{1:nargout}] = gui_mainfcn(gui_state, varargin{:}); else gui_mainfcn(gui_state, varargin{:}); % End initialization code - DO NOT EDIT % --- Executes just before Oil_Tank is made visible. function Oil_Tank_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % varargin command line arguments to Oil_Tank (see VARARGIN) % Choose default command line output for Oil_Tank handles.output = hobject; % Update handles structure guidata(hobject, handles); % UIWAIT makes Oil_Tank wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = Oil_Tank_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % Get default command line output from handles structure varargout{1} = handles.output; % --- Executes on button press in pushbutton1. function pushbutton1_callback(hobject, eventdata, handles) % hobject handle to pushbutton1 (see GCBO) IX

oil = evalin('base','oil') a = oil(2,5) switch (a) case 1 set(handles.state_oil,'string','open Phase'); set(handles.causes_oil,'string','warning!!! Check wiring or mains supply'); set(handles.causes_oil,'visible', 'on'); set(handles.possible_oil,'visible', 'on'); case 2 set(handles.state_oil,'string','damage'); set(handles.causes_oil,'string','warning!!! Please check short'); set(handles.causes_oil,'visible', 'on'); set(handles.possible_oil,'visible', 'on'); case 3 set(handles.state_oil,'string','good'); set(handles.causes_oil,'visible', 'off'); set(handles.possible_oil,'visible', 'off'); otherwise set(handles.state_oil,'string','--'); set(handles.causes_oil,'visible', 'on'); set(handles.possible_oil,'visible', 'on'); set(handles.causes_oil,'string',''); % switch (a) % case {a==1} % set(handles.state_oil,'string','good'); % case (a==2) % set(handles.state_oil,'string','bad'); % case (a==3) % set(handles.state_oil,'string','12'); % otherwise % set(handles.state_oil,'string','676'); % a = oil(1,2) set(handles.pressure,'string',a); a = oil(2,2) set(handles.quantity,'string',a); X

function varargout = Weaving_GUI(varargin) % WEAVING_GUI M-file for Weaving_GUI.fig % WEAVING_GUI, by itself, creates a new WEAVING_GUI or raises the existing gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_openingfcn', @Weaving_GUI_OpeningFcn,... 'gui_outputfcn', @Weaving_GUI_OutputFcn,... 'gui_layoutfcn', [],... 'gui_callback', []); if nargin && ischar(varargin{1}) gui_state.gui_callback = str2func(varargin{1}); if nargout [varargout{1:nargout}] = gui_mainfcn(gui_state, varargin{:}); else gui_mainfcn(gui_state, varargin{:}); % End initialization code - DO NOT EDIT % --- Executes just before Weaving_GUI is made visible. function Weaving_GUI_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % varargin command line arguments to Weaving_GUI (see VARARGIN) % Choose default command line output for Weaving_GUI handles.output = hobject; % Update handles structure guidata(hobject, handles); % UIWAIT makes Weaving_GUI wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = Weaving_GUI_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % Get default command line output from handles structure varargout{1} = handles.output; %[x,map]=imread('ira.jpg','jpg'); %image(x),colormap(map),axis off,hold on %-------------start clock and date----------------------------------- -- XI

% set(handles.date1,'string',date); % x=1 % while x % t=clock; % set(handles.time1,'string',[num2str(fix(t(4))),':',num2str(fix(t(5))),':',num2str(fix(t(6)))]) % drawnow % %------------- time and date------------------------------------- % --- Executes on button press in pushbutton1. function pushbutton1_callback(hobject, eventdata, handles) % hobject handle to pushbutton1 (see GCBO) %-------------------------------------------------------------- weaving_section_1figurehandle = weaving_section_1; %stores the figure handle of Quan's GUI here %stores the GUI data from Quan's GUI here %now we can access any of the data from Quan's GUI!!!! weaving_section_1data = guidata(weaving_section_1figurehandle); %store the input text from Quan's GUI %into the variable quan_input %weaving_section_1_input = get(weaving_section_1data.window2_edit1,'string'); %-------------------------------------------------------------- % --- Executes on button press in pushbutton2. function pushbutton2_callback(hobject, eventdata, handles) % hobject handle to pushbutton2 (see GCBO) % --- Executes on button press in pushbutton3. function pushbutton3_callback(hobject, eventdata, handles) % hobject handle to pushbutton3 (see GCBO) % --- Executes on button press in pushbutton4. function pushbutton4_callback(hobject, eventdata, handles) % hobject handle to pushbutton4 (see GCBO) close all % --- Executes on button press in pushbutton4. function pushbutton5_callback(hobject, eventdata, handles) % hobject handle to pushbutton4 (see GCBO) XII

function varargout = Emergency_faults(varargin) % EMERGENCY_FAULTS M-file for Emergency_faults.fig % EMERGENCY_FAULTS, by itself, creates a new EMERGENCY_FAULTS or raises the existing gui_singleton = 1; gui_state = struct('gui_name', mfilename,... 'gui_singleton', gui_singleton,... 'gui_openingfcn', @Emergency_faults_OpeningFcn,... 'gui_outputfcn', @Emergency_faults_OutputFcn,... 'gui_layoutfcn', [],... 'gui_callback', []); if nargin && ischar(varargin{1}) gui_state.gui_callback = str2func(varargin{1}); if nargout [varargout{1:nargout}] = gui_mainfcn(gui_state, varargin{:}); else gui_mainfcn(gui_state, varargin{:}); % End initialization code - DO NOT EDIT % --- Executes just before Emergency_faults is made visible. function Emergency_faults_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % varargin command line arguments to Emergency_faults (see VARARGIN) % Choose default command line output for Emergency_faults handles.output = hobject; % Update handles structure guidata(hobject, handles); % UIWAIT makes Emergency_faults wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = Emergency_faults_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % Get default command line output from handles structure varargout{1} = handles.output; XIII

% --- Executes on button press in pushbutton1. function pushbutton1_callback(hobject, eventdata, handles) % hobject handle to pushbutton1 (see GCBO) environment = evalin('base','environment') a = environment(1,5) switch (a) case 1 set(handles.state_environment,'string','bad'); set(handles.causes_environment,'visible', 'on'); set(handles.possible_envir,'visible', 'on'); set(handles.causes_environment,'string','warning!!! Please check Sprinkler and exaust fan also'); case 2 set(handles.state_environment,'string','medium'); set(handles.causes_environment,'visible', 'on'); set(handles.possible_envir,'visible', 'on'); set(handles.causes_environment,'string','please check Exaust fan'); case 3 set(handles.state_environment,'string','good'); set(handles.causes_environment,'visible', 'off'); set(handles.possible_envir,'visible', 'off'); otherwise set(handles.state_environment,'string','--'); set(handles.causes_environment,'visible', 'on'); set(handles.possible_envir,'visible', 'on'); set(handles.causes_environment,'string',''); a = environment(1,2) set(handles.temperature,'string',a); a = environment(2,2) set(handles.humidity,'string',a); XIV

FIS code for different sections is in following sections [System] Name='Environment' Type='mamdani' Version=2.0 NumInputs=2 NumOutputs=1 NumRules=9 AndMethod='min' OrMethod='max' ImpMethod='min' AggMethod='max' DefuzzMethod='centroid' [Input1] Name='Temperature' Range=[0 60] NumMFs=3 MF1='Low':'trapmf',[-21.6-2.4 14.5238095238095 24.8] MF2='Medium':'trapmf',[17.2238095238095 25.1538095238095 33.2238095238095 39.7238095238095] MF3='High':'trapmf',[34.6 42.1428571428571 62.4 81.6] [Input2] Name='Humidity' Range=[0 100] NumMFs=3 MF1='Low':'trapmf',[-36-4 4 36] MF2='Medium':'trapmf',[18 35 58.9 78.7] MF3='High':'trapmf',[60 81.8783068783069 100 132] [Output1] Name='Environment Condition' Range=[0 1] NumMFs=3 MF1='Bad':'trimf',[-0.4 0 0.4] MF2='Medium':'trimf',[0.1 0.5 0.9] MF3='Good':'trimf',[0.6 1 1.4] [Rules] 1 1, 1 (1) : 1 1 2, 1 (1) : 1 1 3, 1 (1) : 1 2 1, 1 (1) : 1 2 2, 3 (1) : 1 2 3, 2 (1) : 1 3 1, 1 (1) : 1 3 2, 1 (1) : 1 3 3, 1 (1) : 1 [System] Name='Motor Condition' Type='mamdani' Version=2.0 NumInputs=3 XV

NumOutputs=1 NumRules=28 AndMethod='min' OrMethod='max' ImpMethod='min' AggMethod='max' DefuzzMethod='centroid' [Input1] Name='Ia' Range=[0 50] NumMFs=5 MF1='Z':'trimf',[-17.2 0 1.6] MF2='S':'trapmf',[1 2 4 5] MF3='M':'trapmf',[4 9 22 26] MF4='B':'trapmf',[24 31 36 43] MF5='VB':'trimf',[40 50 51] [Input2] Name='Ib' Range=[0 50] NumMFs=5 MF1='Z':'trimf',[-17.2 0 1.6] MF2='S':'trapmf',[1 2 4 5] MF3='M':'trapmf',[4 9 22 26] MF4='B':'trapmf',[24 31 36 43] MF5='VB':'trimf',[40 50 51] [Input3] Name='Ic' Range=[0 50] NumMFs=5 MF1='Z':'trimf',[-17.2 0 1.6] MF2='S':'trapmf',[1 2 4 5] MF3='M':'trapmf',[4 9 22 26] MF4='B':'trapmf',[24 31 36 43] MF5='VB':'trimf',[40 50 51] [Output1] Name='Motor Condition' Range=[0 1] NumMFs=5 MF1='GOOD':'trapmf',[0.805555555555556 0.956 1.04 1.04] MF2='Damage':'trapmf',[0.1 0.188 0.288 0.388] MF3='Over Loaded':'trapmf',[0.541 0.644179894179894 0.719 0.853] MF4='Critically Loaded':'trapmf',[0.35 0.4 0.5 0.6] MF5='Open Phase':'trapmf',[-0.0437037037037037-0.00370370370370371 0.0962962962962963 0.156296296296296] [Rules] 1 1 1, 5 (1) : 1-1 1-1, 5 (1) : 1-1 -1 1, 5 (1) : 1 2 2 2, 1 (1) : 1 2 2 3, 3 (1) : 1 2 3 2, 3 (1) : 1 XVI

2 3 3, 3 (1) : 1 3 2 2, 3 (1) : 1 3 2 3, 3 (1) : 1 3 3 2, 3 (1) : 1 3 3 3, 3 (1) : 1 4 2 2, 4 (1) : 1 4 2 3, 4 (1) : 1 4 3 2, 4 (1) : 1 4 3 3, 4 (1) : 1 2 4 2, 4 (1) : 1 2 4 3, 4 (1) : 1 3 4 2, 4 (1) : 1 3 4 3, 4 (1) : 1 2 2 4, 4 (1) : 1 2 3 4, 4 (1) : 1 3 2 4, 4 (1) : 1 3 3 4, 4 (1) : 1 5 5 5, 2 (1) : 1 5-5 5, 2 (1) : 1-5 5-5, 2 (1) : 1-5 -5 5, 2 (1) : 1 1-1 -1, 5 (1) : 1 [System] Name='OIL' Type='mamdani' Version=2.0 NumInputs=2 NumOutputs=1 NumRules=9 AndMethod='min' OrMethod='max' ImpMethod='min' AggMethod='max' DefuzzMethod='centroid' [Input1] Name='Quantity' Range=[0 20] NumMFs=3 MF1='Low':'trimf',[-10 0 5.164] MF2='Medium':'trapmf',[2 6 13 17] MF3='High':'trimf',[15 20 28] [Input2] Name='Pressure' Range=[0 5] NumMFs=3 MF1='Low':'trimf',[-2 0 1] MF2='Medium':'trapmf',[0.5 2 3 4.3] MF3='High':'trimf',[3.5 5 7] [Output1] Name='Oil_Tank' Range=[0 1] XVII

NumMFs=3 MF1='Good':'trimf',[-0.4 0 0.4] MF2='Medium':'trimf',[0.1 0.5 0.9] MF3='Bad':'trimf',[0.6 1 1.4] [Rules] 1 1, 3 (1) : 1 2 1, 3 (1) : 1 3 1, 3 (1) : 1 2 2, 2 (1) : 1 3 3, 1 (1) : 1 2 3, 1 (1) : 1 1 3, 2 (1) : 1 1 2, 2 (1) : 1 3 2, 3 (1) : 1 XVIII