瀏覽代碼

Fixes #34 Generated code goes to the right file.

Neal Wilson 11 年之前
父節點
當前提交
f04f120bdc
共有 2 個檔案被更改,包括 2051 行新增2043 行删除
  1. 2034
    2032
      src/typica.cpp
  2. 17
    11
      src/typica.w

+ 2034
- 2032
src/typica.cpp
文件差異過大導致無法顯示
查看文件


+ 17
- 11
src/typica.w 查看文件

@@ -746,11 +746,17 @@ undertaking to distribute a binary created from this code, you may want to
746 746
 either determine your rights with regard to these libraries or modify the
747 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 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 760
 @<Header files to include@>@/
755 761
 @<Class declarations@>@/
756 762
 @<Function prototypes for scripting@>@/
@@ -7904,6 +7910,8 @@ of line items is initialized when the second measurement is taken. Subsequent
7904 7910
 measurements are able to simply append new line segments to the list.
7905 7911
 
7906 7912
 @<GraphView Implementation@>=
7913
+#define FULLTIMETOINT(t) (t.msec() + (t.second() * 1000) +  (t.minute() * 60 * 1000))
7914
+
7907 7915
 void GraphView::newMeasurement(Measurement measure, int tempcolumn)@/
7908 7916
 {@/
7909 7917
 	double offset = 0;
@@ -7949,8 +7957,6 @@ even with the minor data loss below.
7949 7957
 
7950 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 7960
 @<Handle the first measurement@>=
7955 7961
 int x = FULLTIMETOINT(measure.time())/1000;
7956 7962
 prevPoints->insert(tempcolumn, QPointF(x, measure.temperature()));
@@ -9873,9 +9879,9 @@ if(nt != s)
9873 9879
 number of seconds in a base time, and the difference between the two. The
9874 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 9882
 @<Load seconds since base time into r@>=
9883
+#define TIMETOINT(t) ((t.hour() * 60 * 60) + (t.minute() * 60) + (t.second()))
9884
+
9879 9885
 time = QTime::currentTime();
9880 9886
 cseconds = TIMETOINT(time);
9881 9887
 oseconds = TIMETOINT(relative);
@@ -9914,9 +9920,9 @@ if(time != s)
9914 9920
 timer starts. The clock that triggers time updates must also be started. The
9915 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 9923
 @<TimerDisplay Implementation@>=
9924
+#define TIMESUBTRACT(t1, t2) (t1.addSecs(-(TIMETOINT(t2))).addSecs(-t2.msec()))
9925
+
9920 9926
 void TimerDisplay::startTimer()@t\2\2@>@/
9921 9927
 {@t\1@>@/
9922 9928
 	if(!running)@/
@@ -11639,9 +11645,9 @@ setting up the settings object and localization in addition to the normal
11639 11645
 responsibilities of |QApplication|. In addition to declaring the class, we also
11640 11646
 define a macro that returns the |Application| instance.
11641 11647
 
11642
-@d AppInstance (qobject_cast<@[Application *@]>(qApp))
11643
-
11644 11648
 @<Class declarations@>=
11649
+#define AppInstance (qobject_cast<@[Application *@]>(qApp))
11650
+
11645 11651
 class NodeInserter;
11646 11652
 class DeviceTreeModel;
11647 11653
 class Application : public QApplication@/

Loading…
取消
儲存