Browse Source

Fixes #34 Generated code goes to the right file.

Neal Wilson 11 years ago
parent
commit
f04f120bdc
2 changed files with 2051 additions and 2043 deletions
  1. 2034
    2032
      src/typica.cpp
  2. 17
    11
      src/typica.w

+ 2034
- 2032
src/typica.cpp
File diff suppressed because it is too large
View File


+ 17
- 11
src/typica.w View File

746
 either determine your rights with regard to these libraries or modify the
746
 either determine your rights with regard to these libraries or modify the
747
 program to remove them.
747
 program to remove them.
748
 
748
 
749
-The following is an overview of the structure of \pn:
750
-
751
-@d PROGRAM_NAME "Typica"
749
+As CWEB generates files with the wrong extension, we leave the default
750
+generated file empty.
752
 
751
 
753
 @c
752
 @c
753
+/* Nothing to see here. */
754
+
755
+@ The following is an overview of the structure of \pn:
756
+
757
+@(typica.cpp@>=
758
+#define PROGRAM_NAME "Typica"
759
+
754
 @<Header files to include@>@/
760
 @<Header files to include@>@/
755
 @<Class declarations@>@/
761
 @<Class declarations@>@/
756
 @<Function prototypes for scripting@>@/
762
 @<Function prototypes for scripting@>@/
7904
 measurements are able to simply append new line segments to the list.
7910
 measurements are able to simply append new line segments to the list.
7905
 
7911
 
7906
 @<GraphView Implementation@>=
7912
 @<GraphView Implementation@>=
7913
+#define FULLTIMETOINT(t) (t.msec() + (t.second() * 1000) +  (t.minute() * 60 * 1000))
7914
+
7907
 void GraphView::newMeasurement(Measurement measure, int tempcolumn)@/
7915
 void GraphView::newMeasurement(Measurement measure, int tempcolumn)@/
7908
 {@/
7916
 {@/
7909
 	double offset = 0;
7917
 	double offset = 0;
7949
 
7957
 
7950
 In the case of the first measurement,
7958
 In the case of the first measurement,
7951
 
7959
 
7952
-@d FULLTIMETOINT(t) (t.msec() + (t.second() * 1000) + (t.minute() * 60 * 1000))
7953
-
7954
 @<Handle the first measurement@>=
7960
 @<Handle the first measurement@>=
7955
 int x = FULLTIMETOINT(measure.time())/1000;
7961
 int x = FULLTIMETOINT(measure.time())/1000;
7956
 prevPoints->insert(tempcolumn, QPointF(x, measure.temperature()));
7962
 prevPoints->insert(tempcolumn, QPointF(x, measure.temperature()));
9873
 number of seconds in a base time, and the difference between the two. The
9879
 number of seconds in a base time, and the difference between the two. The
9874
 value loaded into oseconds could probably be cached.
9880
 value loaded into oseconds could probably be cached.
9875
 
9881
 
9876
-@d TIMETOINT(t) ((t.hour() * 60 * 60) + (t.minute() * 60) + (t.second()))
9877
-
9878
 @<Load seconds since base time into r@>=
9882
 @<Load seconds since base time into r@>=
9883
+#define TIMETOINT(t) ((t.hour() * 60 * 60) + (t.minute() * 60) + (t.second()))
9884
+
9879
 time = QTime::currentTime();
9885
 time = QTime::currentTime();
9880
 cseconds = TIMETOINT(time);
9886
 cseconds = TIMETOINT(time);
9881
 oseconds = TIMETOINT(relative);
9887
 oseconds = TIMETOINT(relative);
9914
 timer starts. The clock that triggers time updates must also be started. The
9920
 timer starts. The clock that triggers time updates must also be started. The
9915
 timer also needs to reset its value if that behavior is desired.
9921
 timer also needs to reset its value if that behavior is desired.
9916
 
9922
 
9917
-@d TIMESUBTRACT(t1, t2) (t1.addSecs(-(TIMETOINT(t2))).addMSecs(-t2.msec()))
9918
-
9919
 @<TimerDisplay Implementation@>=
9923
 @<TimerDisplay Implementation@>=
9924
+#define TIMESUBTRACT(t1, t2) (t1.addSecs(-(TIMETOINT(t2))).addSecs(-t2.msec()))
9925
+
9920
 void TimerDisplay::startTimer()@t\2\2@>@/
9926
 void TimerDisplay::startTimer()@t\2\2@>@/
9921
 {@t\1@>@/
9927
 {@t\1@>@/
9922
 	if(!running)@/
9928
 	if(!running)@/
11639
 responsibilities of |QApplication|. In addition to declaring the class, we also
11645
 responsibilities of |QApplication|. In addition to declaring the class, we also
11640
 define a macro that returns the |Application| instance.
11646
 define a macro that returns the |Application| instance.
11641
 
11647
 
11642
-@d AppInstance (qobject_cast<@[Application *@]>(qApp))
11643
-
11644
 @<Class declarations@>=
11648
 @<Class declarations@>=
11649
+#define AppInstance (qobject_cast<@[Application *@]>(qApp))
11650
+
11645
 class NodeInserter;
11651
 class NodeInserter;
11646
 class DeviceTreeModel;
11652
 class DeviceTreeModel;
11647
 class Application : public QApplication@/
11653
 class Application : public QApplication@/

Loading…
Cancel
Save