Micro-Project Report ON " ": Design Digital Clock

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

A

Micro-Project Report
ON
“DESIGN DIGITAL
CLOCK”

Partial Fulfillment of the Requirement for the Diploma in Computer Engineering,

By
1)Kadam Priti [2014660140]
2) Shaikh Suhana [2014660141]
3) Tarate Gayatri [2114660126]
4) Pacharne Gayatri [2114660128]

Guided By
Prof. Chaure Suraj

Shree Samarth Academy’s


Shree Samarth Polytechnic
Mhasane Phata, Ahmednagar
Maharashtra State Board of Technical Education
(2020-2021)

1
Shree Samarth Academy’s
Shree Samarth Polytechnic
Department of Computer Engineering.

CERTIFICATE
This is to certify that the project work entitled
“DESIGN DIGITAL
CLOCK’’

Is
Submitted by
1)Kadam Priti [2014660140]
5) Shaikh Suhana [2014660141]
6) Tarate Gayatri [2114660126]
7) Pacharne Gayatri [2114660128]

in the partial fulfillment of Diploma in Computer Engineering has been Satisfactory


carried out under my guidance as per the requirement of Maharashtra State Board of
Technical Education, Mumbai during the academic year 2020-2021
Date:
Place:

GUIDE HOD PRINCIPAL


(Prof. Chaure S. M ) (Prof. Chaure S. M) (Prof. Anarse B.V.)

2
Micro-Project Proposal

“DESIGN DIDITAL
CLOCK”

1.0 Brief Introduction:


The project is idea to display the clock with computer graphics.this
project just used the local time,fetching from the computer and display it on
the screen.this project implements the wall clock with the roundcircular board
and three conic geometric which forms the different(sec,min
&hour)hands.Here we are going to use time function to diplay time.In this
project we are going to get output has the current time In this era of
computing, computer graphics has become one of the most powerful and
interesting fact of computing. It all started with display of data on hardcopy
and CRT screen. Now computer graphics is about creation, retrieval,
manipulation of models and images.Graphics today is used in many different
areas. Graphics provides one of the most natural means of communicating
within a computer, since our highly developed 2D and 3D pattern-recognition
abilities allow us to perceive and process pictorial data rapidly and
effectively. Interactive computer graphics is the most important means of
producing pictures since the invention of photography and television. It has
the added advantage that, with the computer, we can make pictures not only
of concrete real world objects but also of abstract, synthetic objects, such as
mathematical surfaces and of data that have no inherent geometry, such
as survey results.OpenGL is an application program interface (API) offering
various functions to implement primitives, models and images

3
3.0 Action plan:

Planned Planned Name of Responsible


Sr.no. Details of activity
start date Finish date Team Member
SEARCHING
1. INFORMATION KADAM PRITI
ABOUT TOPIC
FINDING PACHARNE
2.
INFORMATION GAYATRI
DISCUS WITH
3. TARATE GAYATRI
SUBJECT TEACHER
4. MAKING PROPOSAL SHAIKH SUHANA
5. MAKING REPORT KADAM PRITI
SUBMIT TO SUBJECT ALL GROUP
6.0
TEACHER. MEMBERS

4.0 Actual Resources Used:

S.NO Name of Resource/material Specifications Qty Remarks

1 MS OFFICE 2013 Application 1 -

2 Google Search engine 1 -

4
Format for Micro-Project Report

“DESIGN DIDITAL
CLOCK”
Brief Description:

In this era of computing, computer graphics has become one of the most
powerful and interesting fact of computing. It all started with display of data
on hardcopy and CRT screen. Now computer graphics is about creation,
retrieval, manipulation of models and images.Graphics today is used in many
different areas. Graphics provides one of the most natural means of
communicating within a computer, since our highly developed 2D and 3D
pattern-recognition abilities allow us to perceive and process pictorial data
rapidly and effectively. Interactive computer graphics is the most important
means of producing pictures since the invention of photography and
television. It has the added advantage that, with the computer, we can make
pictures not only of concrete real world objects but also of abstract, synthetic
objects, such as mathematical surfaces and of data that have no inherent
geometry, such as survey results.

OpenGL CONCEPT
INTERFACE
OpenGL is an application program interface (API) offering various functions
to implement primitives, models and images. This offers functions to create
and manipulate render lighting, coloring, viewing the models. OpenGL offers
different coordinate system and frames. OpenGL offers translation, rotation
and scaling of objects. Functions in the main GL library have names that
begins with gl and are stored in a library usually referred to as GL. The
second is the OpenGL Utility Library(GLU). The library uses only GL
functions but contains code for creating common objects and simplifying
viewing. All functions in GLU can be created from the core GL library but
application programmers prefer not to write the code repeatedly. The GLU
library is available in all OpenGL implementations; functions in the GLU
library begin with the letter glu. Rather than using a different library for each
system we use a readily available library called OpenGL Utility
5
Toolkit(GLUT),which provides the minimum functionality that should be
expected in any modern windowing system.
OVERVIEW
• OpenGL(Open Graphics Library) is the interface between a graphics
program and graphics hardware. It is streamlined. In other words, it provides
low-level functionality. For example, all objects are built from points, lines
and convex polygons. Higher level objects like cubes are implemented as six
four-sided polygons.
• OpenGL supports features like 3-dimensions, lighting, anti-aliasing,
shadows, textures, depth effects, etc.
• It is system-independent. It does not assume anything about hardware or
operating system and is only concerned with efficiently rendering
mathematically described scenes. As a result, it does not provide any
windowing capabilities.
• It is a state machine. At any moment during the execution of a program
there is a current model transformation.
• It is a rendering pipeline. The rendering pipeline consists of the following
steps: Defines objects mathematically. Arranges objects in space relative to
a viewpoint. Calculates the color of the objects.

6
OPENGL ARCHITECTURE:

Pipeline Architectures

OPENGL PIPELINE ARCHITECTURE

OpenGL Engine And Drivers

OPENGL ENGINE AND DRIVERS

7
SYSTEM DESIGN

Program Structure :
clockLayout

I’ve used this function to print the clock layout i.e. clock dial and
the markings on the clock. If we observe clearly, the clock has
hours marking each separated by 30 degrees and each hour is
divided into 5 markings each making an angle of 6 degrees. So,
iterating the markings for every 30 degrees gives hours and
iterating markings with 6 degrees give minutes markings on the
clock. The clock would look like this after executing this function.

Image Theory
secHand

It is clear from the name that this gonna do something with the
seconds hand. This function is going to get the present second
from the system clock and incline the line according to a particular
angle. Eg: if the present seconds is 5 then the angle of the
seconds hand with respect to the vertical must be 30 degrees, i.e.
5*6=30.

minHand

This function fulfills the task of moving the minutes hand based
on the system clock. The minutes hand must be inclined 6
degrees for every minute passing. Eg: if the elapsed minutes
are 30 then the minutes hand angle must be making 180
degrees with the vertical.

hrHand

This function is going to print an inclined hours line. The function


is designed to get the present hour and also the no. of elapsed
minutes from the system clock and incline the line according to
a particular angle. For every hour elapsed the hour hand moves
30 degrees and every 12 minutes it moves 6 degrees. main()
The first lines in main are graphic initialization, you must change
the path “c:\turboc3\bgi\” to your compiler’s BGI file path
otherwise program will not work. Coming to the while loop, the
while loop iterates for every 100 milliseconds

8
Working of Analog Clock

Clocks use oscillators to keep the gears in motion. These oscillators have
changed from flowing water to pendulums to quartz crystals, but they all seek to
achieve the same purpose: perpetual motion. The oscillating mechanisms are
powered by a variety of sources, but the two most prevalent power sources are direct
electrical currents or batteries. The electricity or battery power fuels the controller
mechanism, which supplies crucial support to the oscillator. The controller, in turn,
fuels the wheel chain of the analog clock. The wheel chain is responsible for
notching and turning the indicator hands of the clock. So, with each second that
passes, the wheel chain synchronizes the minutes and hours accordingly. It is a
relatively simple process, culminating in the familiar big hand and little hand
indicating the hour and minute. All analog clocks uses gears in intricate fashion to
enhance efficiency but the basic mechanism remains same (even for vertical
designs).

Program Graphics

Most of the objects in the program, such as buttons, grids or cells, are drawn using
OpenGL primitives.
Most of the control buttons used through the program were made as textures in an
image editor and exported as .raw files. The class “Textures” (in Textures.h &
Textures.cpp) handles the loading of these images intomemory and drawing them
on the screen using OpenGL’s texture related function.
Text is drawn after the backbuffer is flushed to the front buffer, by hijacking the
window handle wia Win32 and writing text onto the window via the
Win32ThrowText() function defined in Util.h

9
IMPLEMENTATION SOURCE CODE

#include
<gl/glut.h>
#include <gl/gl.h>
#include <math.h>
#include <time.h>
#include
<sys/timeb.h>

const float clockR = 80.0f,


clockVol =

100.0f, angle1min = M_PI /

30.0f,

minStart

= 0.9f, minEnd

= 1.0f,

stepStart = 0.8f, stepEnd

= 1.0f;

float angleHour
= 0,
angleMin= 0,
angleSec = 0;

void newLine(float rStart, float rEnd,


float angle){ float c = cos(angle), s =
sin(angle);
glVertex2f( clockR*rStart*c,

10
clockR*rStart*s); glVertex2f(
clockR*rEnd*c, clockR*rEnd*s);
}

void
RenderScene(void){
int i;

glClear(GL_COLOR_BUFFER_BIT);

glColor3f(1.0f, 0.0f,
0.0f);
glLineWidth(2.0f);
glEnable(GL_LINE_SMOOTH
);
glEnable(GL_POINT_SMOOT
H);
glEnable(GL_POLYGON_SMO
OTH);

glBegin(GL_LINES);
for(i=0; i<60;
i++){
if(i%5){ // normal
minute if(i%5 == 1)
glColor3f(1.0f, 1.0f, 1.0f);
newLine(minStart, minEnd, i*angle1min);
}else{
glColor3f(1.0f, 0.0f, 0.0f);
newLine(stepStart, stepEnd,
i*angle1min);
}
}
glEnd();

glLineWidth(3.0f
);

11
glBegin(GL_LINES
);
newLine(0.0f, 0.5f, -
angleHour+M_PI/2); newLine(0.0f,
0.8f, -angleMin+M_PI/2);
glEnd();

glLineWidth(1.0f);
glColor3f(0.0f, 0.0f,
1.0f);
glBegin(GL_LINES);
newLine(0.0f, 0.8f, -
angleSec+M_PI/2); glEnd();

glutSwapBuffers();
}

void SetupRC(void){
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
}

///////////////////////////////////////////////////////////
// Called by GLUT library when the window has chanaged
size void ChangeSize(GLsizei w, GLsizei h){
GLfloat aspectRatio;

// Prevent a divide by
zero if(h == 0)
h = 1;

// Set Viewport to window


dimensions glViewport(0, 0, w,
h);

// Reset coordinate system


glMatrixMode(GL_PROJECTIO
N); glLoadIdentity();

// Establish clipping volume (left, right, bottom, top, near,

12
far) aspectRatio = (GLfloat)w / (GLfloat)h;
if (w <= h)
glOrtho (-clockVol, clockVol, -clockVol / aspectRatio,
clockVol / aspectRatio, 1.0, -1.0);
else
glOrtho (-clockVol * aspectRatio, clockVol *
aspectRatio, - clockVol, clockVol, 1.0, -1.0);

glMatrixMode(GL_MODE
LVIEW);
glLoadIdentity();
}

void TimerFunction(int
value){ struct timeb
tb;
time_t
tim=time(0);
struct tm* t;
t=localtime(&
tim);
ftime(&tb);

angleSec = (float)(t->tm_sec+
(float)tb.millitm/1000.0f)/30.0f * M_PI;
angleMin = (float)(t->tm_min)/30.0f * M_PI +
angleSec/60.0f; angleHour = (float)(t->tm_hour > 12 ? t-
>tm_hour-12 : t-
>tm_hour)/6.0f * M_PI+
angleMin/12.0f;
glutPostRedisplay();
glutTimerFunc(33,TimerFunction, 1);
}

///////////////////////////////////////////////////////////
// Main program entry point
int main(int argc, char* argv[]){
glutInit(&argc, argv);

13
glutInitDisplayMode(GLUT_DOUBLE |
GLUT_RGBA); glutCreateWindow("glClock
by bobo");

glutDisplayFunc(RenderScene);
glutReshapeFunc(ChangeSize);
glutTimerFunc(33, TimerFunction, 1);

SetupRC();

glutMainLoop()

return 0;
}

14
OUTPUT OF THE PROGRAM

15
16
CONCLUSIONS
Attempts to represent time in a digital format have been around for ages, with the
first patented design of the ‘Plato’ digital clock of 1903 being introduced at the St.
Louis World Fair in 1904. But analogue soldiers on regardless.Digital displays have
enjoyed periods of popularity but people always seem to move back eventually to
analogue dials in the long term.Personally, I place the eternal popularity to be based
on the instant recognisability of the position of the hands. with the briefest of glances
it is possible to observe the time and a number of other aspects that digits alone do
not instantly convey, I always seemed to have to analyse them to get the picture - a
dial is of course exactly that - the picture.

17
Teacher Evaluation Sheet
Name of Student………………………………………………………………………………………
Enrollment No………………………………………………...….………...….………...….………...
Name of Program…………………………………………………….….....….………...….………...
Semester……………………………………………………………….…....….………...….………..
Course Title…………………………………………………………….…...….………...….………..
Code………………………………………………………………………...….………...….………...
Title of the Micro-Project……………………………………………………………………………...
Course Outcomes Achieved
………………………………………………………………………………………………………………
………………………………………………………………………………………………………………
………………………………………………………………………………………………………………

Evaluation as per suggested Rubric for Assessment of Micro-Project


Sr. Characteristic to be Poor Average Good Excellent
No. assessed (Marks 1-3) (Marks 4- (Marks 6- (Marks 9-10)
5) 8)
1 Relevance to the course
2 Literature survey/
Information Collection
3 Project Proposal
4 Completion of the
Target as per project
proposal
5 Analysis of Data &
Representation
6 Quality of
Prototype/Model
7 Report Preparation
8 Presentation

Micro-Project Evaluation Sheet


Process Assessment Product Assessment Total
Part A- Project Part B-Project Individual Marks
Project Methodology Report/Working Model Presentation/Viva 10
Proposal (2 mark) (2 marks) (4 mark)
(2 marks)

18
Note:
Every course teacher is expected to assign marks for group evolution in first 3 columns & individual
evaluation in 4th columns for each group of students as per rubrics

Comments/Suggestions about team work/leadership/inter-personal communication (if any).


.................................................................................................................................................
.................................................................................................................................................
.........................................................................

Any other comment:


......................................................................................................................................
.................................................................................................................................................
.................................................................................................................................................
.........................................................................

Name and designation of the faculty member........................................................


Signature...................................................................

*****************

19

You might also like