Explorar o código

FinalbugFixes and added tip stop to the right

HonestLocksmith hai 1 ano
pai
achega
43f469d825
Modificáronse 3 ficheiros con 22 adicións e 13 borrados
  1. 18 10
      key_copier.c
  2. 3 2
      key_formats.c
  3. 1 1
      key_formats.h

+ 18 - 10
key_copier.c

@@ -447,11 +447,13 @@ static void key_copier_view_measure_draw_callback(Canvas *canvas, void *model) {
     }
     // new end
 
-    canvas_draw_line(
-        canvas, pin_center_px - pin_half_width_px,
-        bottom_contour_px - current_depth_px, pin_center_px + pin_half_width_px,
-        bottom_contour_px -
-            current_depth_px); // draw bottom pin width horizontal line
+    //      canvas_draw_line(
+    //          canvas,
+    //          pin_center_px - pin_half_width_px,
+    //         bottom_contour_px - current_depth_px,
+    //         pin_center_px + pin_half_width_px,
+    //         bottom_contour_px - current_depth_px); // draw bottom pin width
+    //         horizontal line
 
     int last_depth = my_model->depth[current_pin - 2] - my_format.min_depth_ind;
     int next_depth = my_model->depth[current_pin] - my_format.min_depth_ind;
@@ -462,10 +464,13 @@ static void key_copier_view_measure_draw_callback(Canvas *canvas, void *model) {
       last_depth = 0;
       pre_extra_x_px = max(current_depth_px + pin_half_width_px, 0);
 
-      canvas_draw_line(
-          canvas, 0, bottom_contour_px,
-          pin_center_px - pin_half_width_px - current_depth_px,
-          bottom_contour_px); // draw bottom shoulder (hidden by level contour)
+      //           canvas_draw_line(
+      //               canvas,
+      //               0,
+      //              bottom_contour_px,
+      //              pin_center_px - pin_half_width_px - current_depth_px,
+      //              bottom_contour_px); // draw bottom shoulder (hidden by
+      //              level contour)
     }
     if (current_pin == my_model->format.pin_num) {
       next_depth = 0;
@@ -531,7 +536,10 @@ static void key_copier_view_measure_draw_callback(Canvas *canvas, void *model) {
   canvas_draw_line(canvas, 0, 62, level_contour_px, 62);
   canvas_draw_line(canvas, level_contour_px, 62, level_contour_px + elbow_px,
                    62 - elbow_px);
-  canvas_draw_line(canvas, 1, 1, 1, 63);
+
+  canvas_draw_line(
+      canvas, level_contour_px, 20, level_contour_px,
+      63); // change to if stop ==tip and measure from this point back.
 
   int slc_pin_px =
       (int)round((my_format.first_pin_inch +

+ 3 - 2
key_formats.c

@@ -153,7 +153,7 @@ const KeyFormat all_formats[] = {
      .drill_angle =
          90, // This should actually be 100 but the current resolution will make
      // 100 degrees very ugly and unsuable
-     .uncut_depth_inch = 0.328,
+     .uncut_depth_inch = 0.328, // double check
      .deepest_depth_inch = 0.148,
      .depth_step_inch = 0.020,
      .min_depth_ind = 0,
@@ -210,7 +210,8 @@ const KeyFormat all_formats[] = {
      .pin_increment_inch = 0.092,
      .pin_num = 8,
      .pin_width_inch = 0.039,
-     .elbow_inch = 0.201, //
+     .elbow_inch = 0.201, // this should be equal to first pin inch for tip
+                          // stopped key line
      .drill_angle =
          90, // This should actually be 100 but the current resolution will make
      // 100 degrees very ugly and unsuable

+ 1 - 1
key_formats.h

@@ -7,7 +7,7 @@ typedef struct {
   char *manufacturer;
   char *format_name;
   char *format_link;
-
+  int sides;
   double first_pin_inch;
   double last_pin_inch;
   double pin_increment_inch;