Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
21 views
3 pages
Ponent Ts
Typescript code
Uploaded by
anzeemai
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Download
Save
Save home.component.ts For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
21 views
3 pages
Ponent Ts
Typescript code
Uploaded by
anzeemai
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save home.component.ts For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save home.component.ts For Later
You are on page 1
/ 3
Search
Fullscreen
src/app/features/home/home.component.
ts
1 import { Component } from '@angular/core';
2 import { MContainerComponent } from '../../m-framework/m-container/m-
container.component';
3 import { CommonModule } from '@angular/common';
4 import { FormsModule } from '@angular/forms';
5 import { Reading } from '../../data/Reading';
6 import { MTableComponent } from "../../m-framework/m-table/m-table.component";
7 import { MSearchButtonComponent } from "../../m-framework/m-search-button/m-
search-button.component";
8 import { MLocaldataService } from '../../services/m-localdata.service';
9
10 @Component({
11 selector: 'app-home',
12 standalone: true,
13 imports: [CommonModule, FormsModule, MContainerComponent, MTableComponent,
MSearchButtonComponent],
14 templateUrl: './home.component.html',
15 styleUrl: './home.component.css'
16 })
17
18 export class HomeComponent{
19 temperature: number;
20 highCount: number = 0;
21 elevatedCount: number = 0;
22 normalCount: number = 0;
23 inputTime: Date;
24 headers: string[] = ['reading', 'time'];
25
26 constructor(private mLocaldataService: MLocaldataService) {
27 this.temperature = 0;
28 this.inputTime = new Date();
29 }
30 public get ListOfReadings(){
31 return this.mLocaldataService.getList();
32 }
33
34 recordTimestamp() {
35 this.inputTime = new Date(); // current time
36 return this.inputTime
37 }
38 checkTime(){
39 const readings = this.mLocaldataService.getList();
40 for (const reading of readings) {
41 const existingTimestamp = new Date(reading.time);
42 const timeDiff = Math.abs(this.inputTime.getTime() -
existingTimestamp.getTime());
43 if (timeDiff < 60 * 60 * 1000) { // 1 hour in milliseconds
44 return false;
45 }
46 }
47 return true;
48 }
49
50
51 addReading(){
52 this.recordTimestamp()
53 if (this.checkTime()==true){
54 let reading = new Reading(
55 this.mLocaldataService.getNextID(),
56 this.inputTime,
57 this.temperature
58 );
59 this.mLocaldataService.add(reading);
60 this.temperature = 0 ;
61 this.recordTimestamp();
62 }
63 }
64
65 removeReading(carID: number){
66 this.mLocaldataService.remove(carID);
67 }
68 removeAll(){
69 this.mLocaldataService.removeAll();
70 }
71 navigateReading(){
72 console.log("Called");
73
74 }
75 countFever(){
76 const readings = this.mLocaldataService.getList();
77 readings.forEach(reading => {
78
79 if (reading.temperature >= 40) {
80 this.highCount++;
81 }
82 else if (reading.temperature >= 38 && reading.temperature <= 39.9) {
83 this.elevatedCount++;
84 } else {
85 this.normalCount++;
86 }
87 });
88 };
89 getMResultBoxLabel(){
90 if (this.temperature >= 40) {
91 return "Your temperature is high"
92 }
93 else if (this.temperature >= 38 && this.temperature <= 39.9) {
94
95 return "Your temperature is elevated"
96 }
97 else {
98 return "Your temperature is normal"
99 }
100
101 }
102 getMResultBoxClass(){
103 if (this.temperature >= 40) {
104 return "warning"
105 }
106 else if (this.temperature >= 38 && this.temperature <= 39.9) {
107 return "error"
108 }
109 else {
110 return "success"
111 }
112 }
113 }
114
115
116
117
You might also like
Experiment 10 Aim:To Implement Nosql Database in An Application Theory
PDF
No ratings yet
Experiment 10 Aim:To Implement Nosql Database in An Application Theory
6 pages
Assignment No 1 of Data Structure Note - Attempt Al...
PDF
No ratings yet
Assignment No 1 of Data Structure Note - Attempt Al...
13 pages
2024-11-02
PDF
No ratings yet
2024-11-02
74 pages
Charles Law
PDF
No ratings yet
Charles Law
7 pages
Codigo de C# Adelanto
PDF
No ratings yet
Codigo de C# Adelanto
2 pages
Hotel Prototype Code
PDF
No ratings yet
Hotel Prototype Code
10 pages
Fibaro
PDF
No ratings yet
Fibaro
11 pages
Function Om
PDF
No ratings yet
Function Om
1,835 pages
Device Interfacing With APIs V3
PDF
No ratings yet
Device Interfacing With APIs V3
4 pages
218 Exploring New Data Representations in Healthkit
PDF
No ratings yet
218 Exploring New Data Representations in Healthkit
127 pages
Pooja Oops
PDF
No ratings yet
Pooja Oops
5 pages
Flutter Assignment 2
PDF
No ratings yet
Flutter Assignment 2
66 pages
Filter and Map Examples
PDF
No ratings yet
Filter and Map Examples
4 pages
Nornikel Data Anaconda
PDF
No ratings yet
Nornikel Data Anaconda
11 pages
Custom Cook Free (Berry) .Lua
PDF
No ratings yet
Custom Cook Free (Berry) .Lua
6 pages
Zmdu 0110 Ta FDD TDD 20190204180204 (Utc 07 00)
PDF
No ratings yet
Zmdu 0110 Ta FDD TDD 20190204180204 (Utc 07 00)
11 pages
3
PDF
No ratings yet
3
5 pages
Lab09-Time Series Collections
PDF
No ratings yet
Lab09-Time Series Collections
2 pages
Stake Codigo Fonte
PDF
No ratings yet
Stake Codigo Fonte
40 pages
TRABAJO DE INGLÉS.htm
PDF
No ratings yet
TRABAJO DE INGLÉS.htm
4 pages
Descriptive Geo Me 033051 MBP
PDF
No ratings yet
Descriptive Geo Me 033051 MBP
1,977 pages
28 Lecture
PDF
No ratings yet
28 Lecture
35 pages
Hide
PDF
No ratings yet
Hide
7 pages
Flutter Assignment
PDF
No ratings yet
Flutter Assignment
3 pages
Mid Lab
PDF
No ratings yet
Mid Lab
6 pages
DSA Report: Hospital Area Tracker by Abdullah Mohsin
PDF
No ratings yet
DSA Report: Hospital Area Tracker by Abdullah Mohsin
8 pages
Empty Chamber HD Cycle Run-03 Cycle No-54 Corrected
PDF
No ratings yet
Empty Chamber HD Cycle Run-03 Cycle No-54 Corrected
12 pages
Short Programs
PDF
No ratings yet
Short Programs
41 pages
FeatureRequirement Mapping 1 June Working
PDF
No ratings yet
FeatureRequirement Mapping 1 June Working
7 pages
Import Redfish Import Time From Datetime Import Datetime
PDF
No ratings yet
Import Redfish Import Time From Datetime Import Datetime
6 pages
Curl Api3 CSC
PDF
No ratings yet
Curl Api3 CSC
2 pages
Hadoop Ecosystem
PDF
No ratings yet
Hadoop Ecosystem
22 pages
Week 7 Lab Tutorial Using ThingsBoard
PDF
No ratings yet
Week 7 Lab Tutorial Using ThingsBoard
8 pages
Cod
PDF
No ratings yet
Cod
26 pages
Copy Code
PDF
No ratings yet
Copy Code
17 pages
Unit 5
PDF
No ratings yet
Unit 5
5 pages
Debug-Zuppani-2023-12-20 09 55 06.json
PDF
No ratings yet
Debug-Zuppani-2023-12-20 09 55 06.json
4 pages
Time - 2 Hours Full Marks - 60
PDF
No ratings yet
Time - 2 Hours Full Marks - 60
2 pages
TOS Study Links
PDF
No ratings yet
TOS Study Links
7 pages
Bda Lab Output
PDF
No ratings yet
Bda Lab Output
22 pages
Q1
PDF
No ratings yet
Q1
3 pages
Algorithm Current Situation
PDF
No ratings yet
Algorithm Current Situation
7 pages
MDB Lab Questions Bank June - 2022
PDF
No ratings yet
MDB Lab Questions Bank June - 2022
13 pages
Snipets
PDF
No ratings yet
Snipets
2 pages
Helpers YAML Code
PDF
No ratings yet
Helpers YAML Code
1 page
Guide For The Development of The Practical Component - Unit 2 - Phase 4 - Development of The Simulated Practical Component
PDF
No ratings yet
Guide For The Development of The Practical Component - Unit 2 - Phase 4 - Development of The Simulated Practical Component
15 pages
Sujal2 1
PDF
No ratings yet
Sujal2 1
4 pages
Smart Money Concepts
PDF
No ratings yet
Smart Money Concepts
7 pages
02 BDAV Practicals 5-7
PDF
No ratings yet
02 BDAV Practicals 5-7
40 pages
Best Practices For Time Series Collections - MongoDB Manual v8.0
PDF
No ratings yet
Best Practices For Time Series Collections - MongoDB Manual v8.0
7 pages
bigDataAnalytics hw1 2022 Sol
PDF
No ratings yet
bigDataAnalytics hw1 2022 Sol
9 pages
Usando El Software Hint
PDF
No ratings yet
Usando El Software Hint
19 pages
Documentationthermo Meter
PDF
No ratings yet
Documentationthermo Meter
3 pages
MatreComm (17MCA1033)
PDF
No ratings yet
MatreComm (17MCA1033)
7 pages
High PH Reversed-Phase Peptide Fractionation in A Convenient Spin-Column Format
PDF
No ratings yet
High PH Reversed-Phase Peptide Fractionation in A Convenient Spin-Column Format
1 page
NoSQL Lab Fat
PDF
No ratings yet
NoSQL Lab Fat
46 pages
Linear 1
PDF
No ratings yet
Linear 1
151 pages
2018 Fyp 10
PDF
No ratings yet
2018 Fyp 10
55 pages
3 MapReduce Framework
PDF
No ratings yet
3 MapReduce Framework
28 pages
Computer Engineering Laboratory Solution Primer
From Everand
Computer Engineering Laboratory Solution Primer
Karan Bhandari
No ratings yet
Multi Tenancy in Moodle
PDF
100% (1)
Multi Tenancy in Moodle
34 pages
Sms
PDF
No ratings yet
Sms
98 pages
Addresses Calendar Notepad: Search
PDF
No ratings yet
Addresses Calendar Notepad: Search
4 pages
CDMA RF Performance Analysis & Troubleshooting Guide R28.0 - Final
PDF
No ratings yet
CDMA RF Performance Analysis & Troubleshooting Guide R28.0 - Final
191 pages
PowerGrep Features & Benefits
PDF
No ratings yet
PowerGrep Features & Benefits
32 pages
Feet Template-1
PDF
No ratings yet
Feet Template-1
1 page
01 Introduction PDF
PDF
No ratings yet
01 Introduction PDF
16 pages
Formation of Bus Admittance Matrix Using
PDF
100% (1)
Formation of Bus Admittance Matrix Using
24 pages
The Golden Ratio & The Golden Rectangle: Abstract-This Report Is Showing The Importance
PDF
No ratings yet
The Golden Ratio & The Golden Rectangle: Abstract-This Report Is Showing The Importance
5 pages
External Qs
PDF
No ratings yet
External Qs
5 pages
Credit Card Usage Pattern
PDF
No ratings yet
Credit Card Usage Pattern
3 pages
DEA R Scripts
PDF
No ratings yet
DEA R Scripts
3 pages
Sample EBS Technical - Resume
PDF
No ratings yet
Sample EBS Technical - Resume
5 pages
Array Vs Linked List
PDF
No ratings yet
Array Vs Linked List
7 pages
Advantages and Disadvantages of Information Gathering Techniques
PDF
100% (3)
Advantages and Disadvantages of Information Gathering Techniques
4 pages
Payroll Table Descriptions Hand Book
PDF
0% (2)
Payroll Table Descriptions Hand Book
251 pages
Flux & FluxMotor New Features 12.2
PDF
No ratings yet
Flux & FluxMotor New Features 12.2
88 pages
JYP Entertainment Audition Application: Notice
PDF
No ratings yet
JYP Entertainment Audition Application: Notice
2 pages
TCD 004 DS4
PDF
No ratings yet
TCD 004 DS4
1 page
Kinematics, Workspace, and Design of A Dual-Arm Spatial Robot in Zero Gravity
PDF
No ratings yet
Kinematics, Workspace, and Design of A Dual-Arm Spatial Robot in Zero Gravity
7 pages
Descargar Quiubole para Hombres PDF Gratis
PDF
No ratings yet
Descargar Quiubole para Hombres PDF Gratis
5 pages
Data Representation in Machine Learning Methods With Its Applicat
PDF
No ratings yet
Data Representation in Machine Learning Methods With Its Applicat
100 pages
E Commerce
PDF
No ratings yet
E Commerce
26 pages
C Program Syntax
PDF
No ratings yet
C Program Syntax
27 pages
Step1: Step 2: B) Reissue Via Phonebanking - Through Any HDFC Bank Branch - You Can Collect An Insta Non Personalized Chip + Pin Debit
PDF
No ratings yet
Step1: Step 2: B) Reissue Via Phonebanking - Through Any HDFC Bank Branch - You Can Collect An Insta Non Personalized Chip + Pin Debit
1 page
SAD Chaper8
PDF
100% (1)
SAD Chaper8
33 pages
Creating Textures For Games Part-1
PDF
No ratings yet
Creating Textures For Games Part-1
11 pages
Artificial Intelligence Organizer
PDF
No ratings yet
Artificial Intelligence Organizer
2 pages